CompanyOrganization.php 647 Bytes
Newer Older
romanb's avatar
romanb committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?php

namespace Doctrine\Tests\Models\Company;

/** @Entity @Table(name="company_organizations") */
class CompanyOrganization {
   /**
    * @Id @Column(type="integer")
    * @GeneratedValue(strategy="AUTO")
    */
   private $id;
    
    /**
     * @OneToMany(targetEntity="CompanyEvent", mappedBy="organization", cascade={"persist"})
     */
    private $events;
    
    public function getId() {
        return $this->id;
    }
    
    public function getEvents() {
        return $this->events;
    }
    
    public function addEvent(CompanyEvent $event) {
        $this->events[] = $event;
        $event->setOrganization($this);
    }
}