/** * @param ChildNotification $notification The ChildNotification object to remove. * @return $this|ChildNote The current object (for fluent API support) */ public function removeNotification(ChildNotification $notification) { if ($this->getNotifications()->contains($notification)) { $pos = $this->collNotifications->search($notification); $this->collNotifications->remove($pos); if (null === $this->notificationsScheduledForDeletion) { $this->notificationsScheduledForDeletion = clone $this->collNotifications; $this->notificationsScheduledForDeletion->clear(); } $this->notificationsScheduledForDeletion[] = clone $notification; $notification->setNote(null); } return $this; }
/** * @param ChildNotification $notificationRelatedByOriginTypeOriginId The ChildNotification object to remove. * @return $this|ChildUser The current object (for fluent API support) */ public function removeNotificationRelatedByOriginTypeOriginId(ChildNotification $notificationRelatedByOriginTypeOriginId) { if ($this->getNotificationsRelatedByOriginTypeOriginId()->contains($notificationRelatedByOriginTypeOriginId)) { $pos = $this->collNotificationsRelatedByOriginTypeOriginId->search($notificationRelatedByOriginTypeOriginId); $this->collNotificationsRelatedByOriginTypeOriginId->remove($pos); if (null === $this->notificationsRelatedByOriginTypeOriginIdScheduledForDeletion) { $this->notificationsRelatedByOriginTypeOriginIdScheduledForDeletion = clone $this->collNotificationsRelatedByOriginTypeOriginId; $this->notificationsRelatedByOriginTypeOriginIdScheduledForDeletion->clear(); } $this->notificationsRelatedByOriginTypeOriginIdScheduledForDeletion[] = clone $notificationRelatedByOriginTypeOriginId; $notificationRelatedByOriginTypeOriginId->setOriginUser(null); } return $this; }