4r1y4n

Untitled

Nov 7th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1.     /**
  2.      * Set persons
  3.      *
  4.      * @param array $persons
  5.      * @return Contact
  6.      */
  7.     public function setPersons($persons)
  8.     {
  9.         $this->persons = $persons;
  10.         foreach ($this->persons as $p) $p->setContact($this);
  11.        
  12.         return $this;
  13.     }
  14.  
  15.     /**
  16.      * Get persons
  17.      *
  18.      * @return array
  19.      */
  20.     public function getPersons()
  21.     {
  22.         return $this->persons;
  23.     }
  24.  
  25.     /**
  26.      * Add persons
  27.      *
  28.      * @param \ITW\ContactBundle\Entity\Person $persons
  29.      * @return Contact
  30.      */
  31.     public function addPerson(\ITW\ContactBundle\Entity\Person $person)
  32.     {
  33.      
  34.         $this->persons->add($person);
  35.         $person->setContact($this);
  36.         return $this;
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment