1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/tests/Doctrine/Tests/Models/Cache/Flight.php

65 lines
1.3 KiB
PHP
Raw Normal View History

2013-02-14 02:42:13 +04:00
<?php
namespace Doctrine\Tests\Models\Cache;
/**
* @Entity
* @Table("cache_flight")
* @Cache("NONSTRICT_READ_WRITE")
*/
class Flight
{
const CLASSNAME = __CLASS__;
/**
* @Id
* @Cache
* @ManyToOne(targetEntity="City")
* @JoinColumn(name="leaving_from_city_id", referencedColumnName="id")
*/
protected $leavingFrom;
/**
* @Id
* @Cache
* @ManyToOne(targetEntity="City")
* @JoinColumn(name="going_to_city_id", referencedColumnName="id")
*/
protected $goingTo;
/**
* @Column(type="date")
*/
protected $departure;
/**
* @param \Doctrine\Tests\Models\Cache\City $leavingFrom
* @param \Doctrine\Tests\Models\Cache\City $goingTo
*/
public function __construct(City $leavingFrom, City $goingTo)
{
$this->goingTo = $goingTo;
$this->leavingFrom = $leavingFrom;
$this->departure = new \DateTime();
}
public function getLeavingFrom()
{
return $this->leavingFrom;
}
public function getGoingTo()
{
return $this->goingTo;
}
public function getDeparture()
{
return $this->departure;
}
public function setDeparture($departure)
{
$this->departure = $departure;
}
}