Beispiel #1
0
 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()));
         }
     }
 }
Beispiel #2
0
 public function executeMyServicesFavoris()
 {
     $this->services = MembreServiceTable::getInstance()->getServicesFavoris($this->getUser()->getGuardUser()->getId())->execute();
 }
Beispiel #3
0
 public function isFollowerService($service)
 {
     $res = MembreServiceTable::getInstance()->getCurrentServiceFollower($service, $this->getId())->fetchOne();
     return $res ? true : false;
 }
Beispiel #4
0
 public function removeFollower(sfGuardUser $user, Service $service)
 {
     $assoFollower = MembreServiceTable::getInstance()->getCurrentServiceFollower($service->getPrimaryKey(), $user->getPrimaryKey())->fetchOne();
     $assoFollower->delete();
 }