/** * @param ChildPlayer $participations The ChildPlayer object to remove. * @return $this|ChildAccount The current object (for fluent API support) */ public function removeParticipations(ChildPlayer $participations) { if ($this->getParticipationss()->contains($participations)) { $pos = $this->collParticipationss->search($participations); $this->collParticipationss->remove($pos); if (null === $this->participationssScheduledForDeletion) { $this->participationssScheduledForDeletion = clone $this->collParticipationss; $this->participationssScheduledForDeletion->clear(); } $this->participationssScheduledForDeletion[] = clone $participations; $participations->setAccount(null); } return $this; }
/** * @param ChildPlayer $player The ChildPlayer object to remove. * @return $this|ChildChampionship The current object (for fluent API support) */ public function removePlayer(ChildPlayer $player) { if ($this->getPlayers()->contains($player)) { $pos = $this->collPlayers->search($player); $this->collPlayers->remove($pos); if (null === $this->playersScheduledForDeletion) { $this->playersScheduledForDeletion = clone $this->collPlayers; $this->playersScheduledForDeletion->clear(); } $this->playersScheduledForDeletion[] = clone $player; $player->setChampionship(null); } return $this; }