Example #1
0
 public function executeUpdate()
 {
     if (!$this->getRequestParameter('id')) {
         $peppage = new Peppage();
         $peppage->setCreatedAt(time());
         $peppage->setUpdatedAt(time());
     } else {
         $peppage = PeppagePeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($peppage);
         $peppage->setUpdatedAt(time());
     }
     $peppage->setId($this->getRequestParameter('id'));
     $peppage->setTabname($this->getRequestParameter('tabname'));
     $peppage->setContent($this->getRequestParameter('content'));
     $peppage->setSequence($this->getRequestParameter('sequence'));
     $peppage->save();
     if (!$this->getRequestParameter('id')) {
         $pepuser = new Pepuser();
         $pepuser->setUserId($this->getUser()->getAttribute('userid'));
         $pepuser->setPeppageId($peppage->getId());
         $pepuser->save();
     }
     return $this->redirect('peppage/mylist');
 }
Example #2
0
 public function addPepuser(Pepuser $l)
 {
     $this->collPepusers[] = $l;
     $l->setPeppage($this);
 }