/** * 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_PropelStepInstancePeer::translateFieldName(Ezer_PropelStepInstancePeer::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM); $results = array(); // populate the object(s) while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key = Ezer_PropelStepInstancePeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj = Ezer_PropelStepInstancePeer::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_PropelStepInstancePeer::addInstanceToPool($obj, $key); } // if key exists } $stmt->closeCursor(); return $results; }
/** * @return array<Ezer_IntStep> */ public function getSteps() { return Ezer_PropelStepInstancePeer::retrieveChildSteps($this->getId(), $this->getType()); }
/** * This function performs the validation work for complex object models. * * In addition to checking the current object, all related objects will * also be validated. If all pass then <code>true</code> is returned; otherwise * an aggreagated array of ValidationFailed objects will be returned. * * @param array $columns Array of column names to validate. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise. */ protected function doValidate($columns = null) { if (!$this->alreadyInValidation) { $this->alreadyInValidation = true; $retval = null; $failureMap = array(); if (($retval = Ezer_PropelStepInstancePeer::doValidate($this, $columns)) !== true) { $failureMap = array_merge($failureMap, $retval); } $this->alreadyInValidation = false; } return !empty($failureMap) ? $failureMap : true; }
/** * 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(Ezer_PropelStepInstancePeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(Ezer_PropelStepInstancePeer::DATABASE_NAME); $criteria->add(Ezer_PropelStepInstancePeer::ID, $pks, Criteria::IN); $objs = Ezer_PropelStepInstancePeer::doSelect($criteria, $con); } return $objs; }