/** * Prepares the Criteria object and uses the parent doSelect() * method to get a ResultSet. * * Use this method directly if you want to just get the resultset * (instead of an array of objects). * * @param Criteria $criteria The Criteria object used to build the SELECT statement. * @param Connection $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. * @return ResultSet The resultset object with numerically-indexed fields. * @see BasePeer::doSelect() */ public static function doSelectRS(Criteria $criteria, $con = null) { global $_DBArray; if (!isset($_DBArray)) { $_DBArray = $_SESSION['_DBArray']; } $tableName = $criteria->getDBArrayTable(); if (!isset($_DBArray[$tableName])) { throw new Exception("Error: the table '{$tableName}' doesn't exist in DBArray "); } $arrayTable = $_DBArray[$tableName]; if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } if (!$criteria->getSelectColumns()) { foreach (array_keys($_DBArray[$tableName][0]) as $key => $val) { $criteria->addSelectColumn($tableName . '.' . $val); } } // Set the correct dbName $criteria->setDbName(self::DATABASE_NAME); // BasePeer returns a Creole ResultSet, set to return // rows indexed numerically. return ArrayBasePeer::doSelect($criteria, $tableName, $con); }