/**
  * The returned array will contain objects of the default type or
  * objects that inherit from the default.
  *
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function populateObjects(PDOStatement $stmt)
 {
     $typePosition = Ezer_PropelStepPeer::translateFieldName(Ezer_PropelStepPeer::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
     $results = array();
     // populate the object(s)
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key = Ezer_PropelStepPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj = Ezer_PropelStepPeer::getInstanceFromPool($key))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj->hydrate($row, 0, true); // rehydrate
             $results[] = $obj;
         } else {
             $type = $row[$typePosition];
             $obj = self::newStep($type);
             $obj->hydrate($row);
             $results[] = $obj;
             Ezer_PropelStepPeer::addInstanceToPool($obj, $key);
         }
         // if key exists
     }
     $stmt->closeCursor();
     return $results;
 }
 /**
  * Retrieve a single object by pkey.
  *
  * @param      string $pk the primary key.
  * @param      PropelPDO $con the connection to use
  * @return     Ezer_PropelStep
  */
 public static function retrieveByPK($pk, PropelPDO $con = null)
 {
     if (null !== ($obj = Ezer_PropelStepPeer::getInstanceFromPool((string) $pk))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(Ezer_PropelStepPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(Ezer_PropelStepPeer::DATABASE_NAME);
     $criteria->add(Ezer_PropelStepPeer::ID, $pk);
     $v = Ezer_PropelStepPeer::doSelect($criteria, $con);
     return !empty($v) > 0 ? $v[0] : null;
 }