Пример #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(GroupwfPeer::GRP_UID, $pks, Criteria::IN);
         $objs = GroupwfPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Пример #2
0
 /**
  * Load all the data of a group with a search based on it uid
  *
  * @param $GrpUid group uid
  * @return an array of objects/false/exception object
  *
  */
 public function load($GrpUid)
 {
     try {
         $criteria = new Criteria();
         $criteria->add(GroupwfPeer::GRP_UID, $GrpUid, Criteria::EQUAL);
         $con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
         $objects = GroupwfPeer::doSelect($criteria, $con);
         if (is_array($objects) && count($objects) > 0) {
             return $objects[0];
         } else {
             return false;
         }
     } catch (exception $e) {
         throw $e;
     }
 }