Пример #1
0
 /**
  * Retrieve a single object by pkey.
  *
  * @param      int $pk the primary key.
  * @param      PropelPDO $con the connection to use
  * @return     Closeperiod
  */
 public static function retrieveByPK($pk, PropelPDO $con = null)
 {
     if (null !== ($obj = CloseperiodPeer::getInstanceFromPool((string) $pk))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(CloseperiodPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(CloseperiodPeer::DATABASE_NAME);
     $criteria->add(CloseperiodPeer::ID, $pk);
     $v = CloseperiodPeer::doSelect($criteria, $con);
     return !empty($v) > 0 ? $v[0] : null;
 }