Ejemplo n.º 1
0
 public static function getUserBikesWithAll()
 {
     $bikeArray = UserBikesPeer::getUserBikes();
     $shelfItem = new UserBikes();
     $shelfItem->setBikeMake("(All Bikes)");
     array_push($bikeArray, $shelfItem);
     return $bikeArray;
 }
Ejemplo n.º 2
0
 public function executeAdd()
 {
     if ($this->getRequest()->getMethod() == sfRequest::POST) {
         $userId = sfContext::getInstance()->getUser()->getAttribute('subscriber_id', null, 'subscriber');
         if ($userId) {
             $userBike = new UserBikes();
             $userBike->setBikeYear($this->getRequestParameter('bike_year'));
             $userBike->setBikeModel($this->getRequestParameter('bike_model'));
             $userBike->setBikeMake($this->getRequestParameter('bike_make'));
             $userBike->setDescription($this->getRequestParameter('description'));
             $userBike->setUserId($userId);
             $userBike->save();
             return $this->redirect('userbike/index');
         }
     }
     return sfView::SUCCESS;
 }