2009-09-15 16:24:38 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\Company;
|
|
|
|
|
|
|
|
/** @Entity @Table(name="company_organizations") */
|
|
|
|
class CompanyOrganization {
|
|
|
|
/**
|
|
|
|
* @Id @Column(type="integer")
|
|
|
|
* @GeneratedValue(strategy="AUTO")
|
|
|
|
*/
|
|
|
|
private $id;
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2009-09-15 16:24:38 +04:00
|
|
|
/**
|
|
|
|
* @OneToMany(targetEntity="CompanyEvent", mappedBy="organization", cascade={"persist"})
|
|
|
|
*/
|
|
|
|
private $events;
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2009-09-15 16:24:38 +04:00
|
|
|
public function getId() {
|
|
|
|
return $this->id;
|
|
|
|
}
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2009-09-15 16:24:38 +04:00
|
|
|
public function getEvents() {
|
|
|
|
return $this->events;
|
|
|
|
}
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2009-09-15 16:24:38 +04:00
|
|
|
public function addEvent(CompanyEvent $event) {
|
|
|
|
$this->events[] = $event;
|
|
|
|
$event->setOrganization($this);
|
|
|
|
}
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2009-11-03 21:30:21 +03:00
|
|
|
/**
|
|
|
|
* @OneToOne(targetEntity="CompanyEvent", cascade={"persist"})
|
|
|
|
* @JoinColumn(name="main_event_id", referencedColumnName="id", nullable=true)
|
|
|
|
*/
|
|
|
|
private $mainevent;
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2009-11-03 21:30:21 +03:00
|
|
|
public function getMainEvent() {
|
|
|
|
return $this->mainevent;
|
|
|
|
}
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2009-11-03 21:30:21 +03:00
|
|
|
public function setMainEvent($event) {
|
|
|
|
$this->mainevent = $event;
|
|
|
|
}
|
2009-09-15 16:24:38 +04:00
|
|
|
}
|