示例#1
0
 /**
  * @param	PlayerCourt $playerCourt The playerCourt object to add.
  */
 protected function doAddPlayerCourt($playerCourt)
 {
     $this->collPlayerCourts[] = $playerCourt;
     $playerCourt->setPlayer($this);
 }
示例#2
0
 /**
  * @param	Player $player The player object to add.
  */
 protected function doAddPlayer(Player $player)
 {
     // set the back reference to this object directly as using provided method either results
     // in endless loop or in multiple relations
     if (!$player->getCourts()->contains($this)) {
         $playerCourt = new PlayerCourt();
         $playerCourt->setPlayer($player);
         $this->addPlayerCourt($playerCourt);
         $foreignCollection = $player->getCourts();
         $foreignCollection[] = $this;
     }
 }