Пример #1
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(ContentPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(ContentPeer::DATABASE_NAME);
         $criteria->add(ContentPeer::ID, $pks, Criteria::IN);
         $objs = ContentPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Пример #2
0
 /**
  * Retrieve object using using composite pkey values.
  * @param string $con_category
  * @param string $con_parent
  * @param string $con_id
  * @param string $con_lang
  * @param      Connection $con
  * @return     Content
  */
 public static function retrieveByPK($con_category, $con_parent, $con_id, $con_lang, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(ContentPeer::CON_CATEGORY, $con_category);
     $criteria->add(ContentPeer::CON_PARENT, $con_parent);
     $criteria->add(ContentPeer::CON_ID, $con_id);
     $criteria->add(ContentPeer::CON_LANG, $con_lang);
     $v = ContentPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }