/** * @param ChildCompositionEntity $compositionEntityRelatedById The ChildCompositionEntity object to remove. * @return $this|ChildCompositionEntity The current object (for fluent API support) */ public function removeCompositionEntityRelatedById(ChildCompositionEntity $compositionEntityRelatedById) { if ($this->getCompositionEntitiesRelatedById()->contains($compositionEntityRelatedById)) { $pos = $this->collCompositionEntitiesRelatedById->search($compositionEntityRelatedById); $this->collCompositionEntitiesRelatedById->remove($pos); if (null === $this->compositionEntitiesRelatedByIdScheduledForDeletion) { $this->compositionEntitiesRelatedByIdScheduledForDeletion = clone $this->collCompositionEntitiesRelatedById; $this->compositionEntitiesRelatedByIdScheduledForDeletion->clear(); } $this->compositionEntitiesRelatedByIdScheduledForDeletion[] = $compositionEntityRelatedById; $compositionEntityRelatedById->setCompositionEntityRelatedByForkedid(null); } return $this; }
/** * @param ChildCompositionEntity $compositionEntity The ChildCompositionEntity object to remove. * @return $this|ChildUser The current object (for fluent API support) */ public function removeCompositionEntity(ChildCompositionEntity $compositionEntity) { if ($this->getCompositionEntities()->contains($compositionEntity)) { $pos = $this->collCompositionEntities->search($compositionEntity); $this->collCompositionEntities->remove($pos); if (null === $this->compositionEntitiesScheduledForDeletion) { $this->compositionEntitiesScheduledForDeletion = clone $this->collCompositionEntities; $this->compositionEntitiesScheduledForDeletion->clear(); } $this->compositionEntitiesScheduledForDeletion[] = clone $compositionEntity; $compositionEntity->setUser(null); } return $this; }