2010-01-31 17:35:10 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\Routing;
|
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class RoutingRoute
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Id
|
|
|
|
* @generatedValue(strategy="AUTO")
|
|
|
|
* @column(type="integer")
|
|
|
|
*/
|
|
|
|
public $id;
|
|
|
|
|
|
|
|
/**
|
2010-02-15 00:21:43 +03:00
|
|
|
* @ManyToMany(targetEntity="RoutingLeg", cascade={"all"})
|
2010-01-31 17:35:10 +03:00
|
|
|
* @JoinTable(name="RoutingRouteLegs",
|
|
|
|
* joinColumns={@JoinColumn(name="route_id", referencedColumnName="id")},
|
|
|
|
* inverseJoinColumns={@JoinColumn(name="leg_id", referencedColumnName="id", unique=true)}
|
|
|
|
* )
|
2010-02-27 00:26:06 +03:00
|
|
|
* @OrderBy({"departureDate" = "ASC"})
|
2010-01-31 17:35:10 +03:00
|
|
|
*/
|
|
|
|
public $legs;
|
|
|
|
|
2010-02-15 00:21:43 +03:00
|
|
|
/**
|
|
|
|
* @OneToMany(targetEntity="RoutingRouteBooking", mappedBy="route")
|
2010-02-27 00:26:06 +03:00
|
|
|
* @OrderBy({"passengerName" = "ASC"})
|
2010-02-15 00:21:43 +03:00
|
|
|
*/
|
|
|
|
public $bookings = array();
|
|
|
|
|
2010-01-31 17:35:10 +03:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->legs = new ArrayCollection();
|
|
|
|
}
|
|
|
|
}
|