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

Commit

Permalink
APOLLO-3946 Updated manytomany on person/correspondence
Browse files Browse the repository at this point in the history
  • Loading branch information
brettminnie committed Sep 24, 2014
1 parent 5feef26 commit f0e07cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Opg/Common/Model/Entity/HasCorrespondenceInterface.php
Expand Up @@ -2,7 +2,7 @@
namespace Opg\Common\Model\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Opg\Core\Model\Entity\Correspondence\Correspondence as CorrespondenceEntity;
use Opg\Core\Model\Entity\Correspondence\BaseCorrespondence as CorrespondenceEntity;

/**
* Interface HasCorrespondenceInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Opg/Common/Model/Entity/Traits/HasCorrespondence.php
Expand Up @@ -2,7 +2,7 @@
namespace Opg\Common\Model\Entity\Traits;

use Doctrine\Common\Collections\ArrayCollection;
use Opg\Core\Model\Entity\Correspondence\Correspondence as CorrespondenceEntity;
use Opg\Core\Model\Entity\Correspondence\BaseCorrespondence as CorrespondenceEntity;

/**
* Companion trait to the HasCorrespondenceInterface
Expand Down
Expand Up @@ -41,14 +41,10 @@ abstract class BaseCorrespondence implements EntityInterface, \IteratorAggregate
/**
* @ORM\ManyToMany(
* targetEntity="Opg\Core\Model\Entity\Person\Person",
* mappedBy="correspondence",
* fetch="EAGER",
* cascade={"persist"}
* )
* @ORM\JoinTable(name="person_correspondence",
* joinColumns={@ORM\JoinColumn(name="correspondence_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="person_id", referencedColumnName="id")}
* )
* @ORM\OrderBy({"id"="ASC"})
* @var Person
*/
protected $correspondent;
Expand Down
9 changes: 5 additions & 4 deletions src/Opg/Core/Model/Entity/Person/Person.php
Expand Up @@ -121,11 +121,12 @@ abstract class Person implements HasUidInterface, HasNotesInterface, EntityInter
protected $notes;

/**
* @ORM\ManyToMany(targetEntity = "Opg\Core\Model\Entity\Correspondence\Correspondence", cascade={"persist"})
* @ORM\JoinTable(name="person_correspondence",
* joinColumns={@ORM\JoinColumn(name="person_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="correspondence_id", referencedColumnName="id")}
* @ORM\ManyToMany(
* targetEntity = "Opg\Core\Model\Entity\Correspondence\BaseCorrespondence",
* inversedBy="correspondent",
* cascade={"persist"}
* )
* @ORM\JoinTable(name="person_correspondence")
* @ORM\OrderBy({"id"="ASC"})
* @var ArrayCollection
* @ReadOnly
Expand Down

0 comments on commit f0e07cb

Please sign in to comment.