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

Commit

Permalink
Updated visibility of setParent method, if it is internal it should b…
Browse files Browse the repository at this point in the history
…e protected
  • Loading branch information
brettminnie committed May 27, 2014
1 parent 87e3155 commit 554e95a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Opg/Core/Model/Entity/Person/Person.php
Expand Up @@ -201,16 +201,26 @@ public function __construct()
$this->children = new ArrayCollection();
}

/**
* @return ArrayCollection
*/
public function getChildren()
{
return $this->children;
}

/**
* @return mixed
*/
public function getParent()
{
return $this->parent;
}

/**
* @param Person $person
* @throws \LogicException
*/
public function addChild(Person $person)
{
if ($person === $this) {
Expand All @@ -222,9 +232,11 @@ public function addChild(Person $person)
}

/**
* @internal only invoked by addChild(), not for public consumption
* @param Person $person
* @throws \LogicException
* @internal
*/
public function setParent(Person $person)
protected function setParent(Person $person)
{
if ($this->parent !== null) {
throw new \LogicException('This person is already associated with another parent.');
Expand Down

0 comments on commit 554e95a

Please sign in to comment.