RoutingRoute.php 867B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Doctrine\Tests\Models\Routing;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. /**
  5. * @Entity
  6. */
  7. class RoutingRoute
  8. {
  9. /**
  10. * @Id
  11. * @GeneratedValue
  12. * @column(type="integer")
  13. */
  14. public $id;
  15. /**
  16. * @ManyToMany(targetEntity="RoutingLeg", cascade={"all"})
  17. * @JoinTable(name="RoutingRouteLegs",
  18. * joinColumns={@JoinColumn(name="route_id", referencedColumnName="id")},
  19. * inverseJoinColumns={@JoinColumn(name="leg_id", referencedColumnName="id", unique=true)}
  20. * )
  21. * @OrderBy({"departureDate" = "ASC"})
  22. */
  23. public $legs;
  24. /**
  25. * @OneToMany(targetEntity="RoutingRouteBooking", mappedBy="route")
  26. * @OrderBy({"passengerName" = "ASC"})
  27. */
  28. public $bookings = array();
  29. public function __construct()
  30. {
  31. $this->legs = new ArrayCollection();
  32. }
  33. }