Example #1
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      Connection $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *       rethrown wrapped into a PropelException.
  */
 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(UsersPeer::USR_UID, $pks, Criteria::IN);
         $objs = UsersPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #2
0
 public function executeProfile()
 {
     $userId = sfContext::getInstance()->getUser()->getAttribute('subscriber_id', null, 'subscriber');
     if ($userId) {
         $c = new Criteria();
         $c->add(UsersPeer::USER_ID, $userId);
         $this->user = UsersPeer::doSelect($c);
     }
 }