示例#1
0
 public function executeDelete()
 {
     $pepuser = PepuserPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($pepuser);
     $pepuser->delete();
     return $this->redirect('pepuser/list');
 }
 public function executeSitetabs()
 {
     //$userid = $this->getRequestParameter('id');
     $username = $this->getRequestParameter('un');
     $c = new Criteria();
     $c->add(UserPeer::USERNAME, $username);
     $user = UserPeer::doSelectOne($c);
     $c = new Criteria();
     $c->add(PepuserPeer::USER_ID, $user->getId());
     $c->addJoin(PepuserPeer::PEPPAGE_ID, PeppagePeer::ID);
     $c->addAscendingOrderByColumn(PeppagePeer::SEQUENCE);
     $this->userpages = PepuserPeer::doSelect($c);
     $homepage = PepuserPeer::doSelectOne($c);
     $tabid = $this->getRequestParameter('tid');
     if (!$tabid) {
         $tabid = $homepage->getPeppageId();
     }
     $this->tabid = $tabid;
     //$this->userid = $userid;
     //$user = UserPeer::retrieveByPK($userid);
     $this->username = $user->getUsername();
 }
示例#3
0
 public function getPepusersJoinUser($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BasePepuserPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPepusers === null) {
         if ($this->isNew()) {
             $this->collPepusers = array();
         } else {
             $criteria->add(PepuserPeer::PEPPAGE_ID, $this->getId());
             $this->collPepusers = PepuserPeer::doSelectJoinUser($criteria, $con);
         }
     } else {
         $criteria->add(PepuserPeer::PEPPAGE_ID, $this->getId());
         if (!isset($this->lastPepuserCriteria) || !$this->lastPepuserCriteria->equals($criteria)) {
             $this->collPepusers = PepuserPeer::doSelectJoinUser($criteria, $con);
         }
     }
     $this->lastPepuserCriteria = $criteria;
     return $this->collPepusers;
 }
示例#4
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = PepuserPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setUserId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setPeppageId($arr[$keys[2]]);
     }
 }
示例#5
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(PepuserPeer::ID, $pks, Criteria::IN);
         $objs = PepuserPeer::doSelect($criteria, $con);
     }
     return $objs;
 }