/** * @param Activity $activity * @param bool $flush * @return Activity */ public function remove(Activity $activity, $flush = true) { $activity->setReplanned(null); $activity->setReplannedBy(null); $this->em->remove($activity); if ($flush) { $this->em->flush(); } return $activity; }
/** * Set replannedBy * * @param \Enigmatic\CRMBundle\Entity\Activity $replannedBy * @return Activity */ public function setReplannedBy(\Enigmatic\CRMBundle\Entity\Activity $replannedBy = null) { if ($replannedBy) { $replannedBy->setReplanned($this); } elseif ($this->replannedBy) { $this->replannedBy->setReplanned(null); } $this->replannedBy = $replannedBy; return $this; }