Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
Added default orderings to the collections
Browse files Browse the repository at this point in the history
  • Loading branch information
brettminnie committed Sep 16, 2014
1 parent bd3a19f commit 6774c5f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Opg/Core/Model/Entity/Person/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ abstract class Person implements HasUidInterface, HasNotesInterface, EntityInter
* joinColumns={@ORM\JoinColumn(name="person_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="pa_id", referencedColumnName="id")}
* )
*
* @ORM\OrderBy({"id"="ASC"})
* @var ArrayCollection
* @MaxDepth(5)
* @ReadOnly
Expand All @@ -102,6 +102,7 @@ abstract class Person implements HasUidInterface, HasNotesInterface, EntityInter
* joinColumns={@ORM\JoinColumn(name="person_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="deputyship_id", referencedColumnName="id")}
* )
* @ORM\OrderBy({"id"="ASC"})
* @MaxDepth(5)
* @var ArrayCollection
* @ReadOnly
Expand All @@ -114,6 +115,7 @@ abstract class Person implements HasUidInterface, HasNotesInterface, EntityInter
* joinColumns={@ORM\JoinColumn(name="person_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="note_id", referencedColumnName="id")}
* )
* @ORM\OrderBy({"id"="ASC"})
* @var ArrayCollection
* @ReadOnly
*/
Expand All @@ -125,6 +127,7 @@ abstract class Person implements HasUidInterface, HasNotesInterface, EntityInter
* joinColumns={@ORM\JoinColumn(name="person_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="correspondence_id", referencedColumnName="id")}
* )
* @ORM\OrderBy({"id"="ASC"})
* @var ArrayCollection
* @ReadOnly
*/
Expand Down Expand Up @@ -179,12 +182,14 @@ abstract class Person implements HasUidInterface, HasNotesInterface, EntityInter

/**
* @ORM\OneToMany(targetEntity="Opg\Core\Model\Entity\Address\Address", mappedBy="person", cascade={"all"}, fetch="EAGER")
* @ORM\OrderBy({"id"="ASC"})
* @var \Opg\Core\Model\Entity\Address\Address
*/
protected $addresses;

/**
* @ORM\OneToMany(targetEntity="Opg\Core\Model\Entity\PhoneNumber\PhoneNumber", mappedBy="person", cascade={"all"}, fetch="EAGER")
* @ORM\OrderBy({"id"="ASC"})
* @var ArrayCollection
*/
protected $phoneNumbers;
Expand All @@ -196,13 +201,15 @@ abstract class Person implements HasUidInterface, HasNotesInterface, EntityInter

/**
* @ORM\OneToMany(targetEntity = "Person", mappedBy = "parent")
* @ORM\OrderBy({"id"="ASC"})
* @Type("ArrayCollection<Opg\Core\Model\Entity\Person\Person>")
* @ReadOnly
*/
private $children;

/**
* @ORM\OneToMany(targetEntity="Opg\Core\Model\Entity\Warning\Warning", mappedBy="person", cascade={"all"}, fetch="EAGER")
* @ORM\OrderBy({"id"="ASC"})
* @var ArrayCollection
* @Accessor(getter="getActiveWarnings")
*/
Expand Down

0 comments on commit 6774c5f

Please sign in to comment.