public function executeIndex(sfWebRequest $request) { $this->services = ServiceTable::getInstance()->getServicesList()->execute(); $this->membre_services = array(); if ($this->getUser()->isAuthenticated()) { $membre_services = MembreServiceTable::getInstance()->getServicesFavoris($this->getUser()->getGuardUser()->getId())->execute(); foreach ($membre_services as $membre_service) { array_push($this->membre_services, intval($membre_service->getService()->getId())); } } }
public function executeMyServicesFavoris() { $this->services = MembreServiceTable::getInstance()->getServicesFavoris($this->getUser()->getGuardUser()->getId())->execute(); }
public function isFollowerService($service) { $res = MembreServiceTable::getInstance()->getCurrentServiceFollower($service, $this->getId())->fetchOne(); return $res ? true : false; }
public function removeFollower(sfGuardUser $user, Service $service) { $assoFollower = MembreServiceTable::getInstance()->getCurrentServiceFollower($service->getPrimaryKey(), $user->getPrimaryKey())->fetchOne(); $assoFollower->delete(); }