/** * @param ChildActivity $activityRelatedByTargetId The ChildActivity object to remove. * @return $this|ChildActivityObject The current object (for fluent API support) */ public function removeActivityRelatedByTargetId(ChildActivity $activityRelatedByTargetId) { if ($this->getActivitiesRelatedByTargetId()->contains($activityRelatedByTargetId)) { $pos = $this->collActivitiesRelatedByTargetId->search($activityRelatedByTargetId); $this->collActivitiesRelatedByTargetId->remove($pos); if (null === $this->activitiesRelatedByTargetIdScheduledForDeletion) { $this->activitiesRelatedByTargetIdScheduledForDeletion = clone $this->collActivitiesRelatedByTargetId; $this->activitiesRelatedByTargetIdScheduledForDeletion->clear(); } $this->activitiesRelatedByTargetIdScheduledForDeletion[] = $activityRelatedByTargetId; $activityRelatedByTargetId->setTarget(null); } return $this; }
/** * @param ChildActivity $activity The ChildActivity object to remove. * @return $this|ChildUser The current object (for fluent API support) */ public function removeActivity(ChildActivity $activity) { if ($this->getActivities()->contains($activity)) { $pos = $this->collActivities->search($activity); $this->collActivities->remove($pos); if (null === $this->activitiesScheduledForDeletion) { $this->activitiesScheduledForDeletion = clone $this->collActivities; $this->activitiesScheduledForDeletion->clear(); } $this->activitiesScheduledForDeletion[] = clone $activity; $activity->setActor(null); } return $this; }