/** * @param ChildMatch $match The ChildMatch object to remove. * @return $this|ChildRound The current object (for fluent API support) */ public function removeMatch(ChildMatch $match) { if ($this->getMatches()->contains($match)) { $pos = $this->collMatches->search($match); $this->collMatches->remove($pos); if (null === $this->matchesScheduledForDeletion) { $this->matchesScheduledForDeletion = clone $this->collMatches; $this->matchesScheduledForDeletion->clear(); } $this->matchesScheduledForDeletion[] = clone $match; $match->setRound(null); } return $this; }
/** * @param ChildMatch $matchRelatedByAwayteamId The ChildMatch object to remove. * @return $this|ChildTeam The current object (for fluent API support) */ public function removeMatchRelatedByAwayteamId(ChildMatch $matchRelatedByAwayteamId) { if ($this->getMatchesRelatedByAwayteamId()->contains($matchRelatedByAwayteamId)) { $pos = $this->collMatchesRelatedByAwayteamId->search($matchRelatedByAwayteamId); $this->collMatchesRelatedByAwayteamId->remove($pos); if (null === $this->matchesRelatedByAwayteamIdScheduledForDeletion) { $this->matchesRelatedByAwayteamIdScheduledForDeletion = clone $this->collMatchesRelatedByAwayteamId; $this->matchesRelatedByAwayteamIdScheduledForDeletion->clear(); } $this->matchesRelatedByAwayteamIdScheduledForDeletion[] = clone $matchRelatedByAwayteamId; $matchRelatedByAwayteamId->setAwayteam(null); } return $this; }