classes/database/orm.php
/**
	 * Fetch an array of objects from the database optionally limiting by
	 * certain column values.
	 *
	 * @param array $where an array of column conditions
	 * @param int $limit SQL result limit
	 * @param int $offset SQL result offset
	 * @return array|boolean
	 */
Fetch an array of objects from the database optionally limiting by
certain column values.

@param array $where an array of column conditions
@param int $limit SQL result limit
@param int $offset SQL result offset
@return array|boolean
Fetch an array of objects from the database optionally limiting by certain column values . @param array $where an array of column conditions @param int $limit SQL result limit @param int $offset SQL result offset @return array|boolean
public function fetch(array $where = NULL, $limit = NULL, $offset = NULL)
	{
		$sql = 'SELECT * FROM "'. $this->name(). '"';
		if($where)
		{
			$sql .= ' WHERE '. implode(' = ? AND ', array_keys($where)). ' = ? ';
		}
		if($limit)
		{
			$sql .= ' LIMIT '. ( isset($offset) ? $offset. ',' : ''). $limit;
		}
		return $this->_db->fetch($sql, ($where ? array_values($where) : array()), get_class($this));
	}
public function fetch ( array $ where = NULL , $ limit = NULL , $ offset = NULL ) { $ sql = 'SELECT * FROM "' . $ this -> name ( ) . '"' ; if ( $ where ) { $ sql .= ' WHERE ' . implode ( ' = ? AND ' , array_keys ( $ where ) ) . ' = ? ' ; } if ( $ limit ) { $ sql .= ' LIMIT ' . ( isset ( $ offset ) ? $ offset . ',' : '' ) . $ limit ; } return $ this -> _db -> fetch ( $ sql , ( $ where ? array_values ( $ where ) : array ( ) ) , get_class ( $ this ) ) ; }
Fetch an array of objects from the database optionally limiting by
 certain column values.
Fetch an array of objects from the database optionally limiting by certain column values .
// Add column clauses // If a limit/offset were given // Return the objects