/** * Fetchs objects using the variable values specified in epObject * If the object is null, get all objects in table. * @param epObject $o * @param epClassMap * @param array (of integer) $oids_ex object ids to be excluded * @param array (of integer) $oids_in object ids to be included * @param bool $objs convert the rows into objects or leave as uoids * @return false|array */ public function fetch($cm, $o = null, $oids_ex = null, $oids_in = null, $objs = true) { // check if class is abstract if ($cm->isAbstract()) { throw new epExceptionDbObject('Class [' . $cm->getName() . '] is abstract'); return self::$false; } // make sure the table is created if (!$this->create($cm, false)) { return self::$false; } // preapre sql statement if (!($sql = epObj2Sql::sqlSelect($this, $cm, $o, $oids_ex, $oids_in))) { return self::$false; } // execute sql if (!$this->_execute($sql)) { return self::$false; } if ($objs) { // result conversion $r = $this->_rs2obj($cm, $oids_ex); } else { $r = $this->_rs2uoid($cm, $oids_ex); } return $r; }
/** * Fetchs objects using the variable values specified in epObject * If the object is null, get all objects in table. * @param epObject $o * @param epClassMap * @param array (of integer) object ids to be excluded * @return false|array */ public function &fetch($cm, $o = null, $ex = null) { // make sure the table is created if (!$this->create($cm, false)) { return self::$false; } // preapre sql statement if (!($sql = epObj2Sql::sqlSelect($this, $cm, $o, $ex))) { return self::$false; } // execute sql if (!$this->_execute($sql)) { return self::$false; } // result conversion $r =& $this->_rs2obj($cm, $ex); return $r; }