예제 #1
0
 public function addSuggestedFeature(SuggestedFeature $l)
 {
     $this->collSuggestedFeatures[] = $l;
     $l->setsfGuardUser($this);
 }
예제 #2
0
 public function executeSaveNew()
 {
     $this->forward404Unless($this->getUser()->isAuthenticated());
     $user = $this->getContext()->getInstance()->getUser();
     $referer = $user->getAttribute('referer', $this->getRequest()->getReferer());
     $suggested_feature = new SuggestedFeature();
     $suggested_feature->setUserId($this->getUser()->getId());
     $suggested_feature->setTitle($this->getRequestParameter('title'));
     $suggested_feature->setDescription($this->getRequestParameter('description'));
     $suggested_feature->setStatus(sfConfig::get('app_feature_status_open'));
     $suggested_feature->setType($this->getRequestParameter('type', sfConfig::get('app_feature_type_feature')));
     $suggested_feature->setCategory($this->getRequestParameter('category'));
     $suggested_feature->save();
     $suggested_feature->recommend($this->getUser()->getId());
     $suggested_feature->getsfGuardUser()->getProfile()->addKarma(sfConfig::get('app_karma_submit_feature_points'));
     return $this->redirect($referer);
 }