public function isAttend(\Club\TeamBundle\Entity\Schedule $schedule) { foreach ($this->getSchedules() as $sch) { if ($schedule->getId() == $sch->getSchedule()->getId()) { return true; } } return false; }
private function promoteParent(\Club\TeamBundle\Entity\Schedule $old_parent, \Club\TeamBundle\Entity\Schedule $schedule) { $em = $this->getDoctrine()->getManager(); $schedule->setSchedule(null); $repetition = $em->getRepository('ClubTeamBundle:Repetition')->findOneBy(array('schedule' => $old_parent->getId())); $repetition->setSchedule($schedule); $em->persist($repetition); return $schedule; }