public static function fetch($sortby = 'id', $sortdirection = 'ASC', $limit = null, $start = null, $where = null, $joins = null)
    {
        $sortby = is_null($sortby) ? 'id' : Symphony::Database()->cleanValue($sortby);
        $sortdirection = $sortdirection === 'ASC' ? 'ASC' : 'DESC';

        $records = Symphony::Database()->fetch(sprintf(
            "SELECT a.*
            FROM `tbl_authors` AS `a`
            %s
            WHERE %s
            ORDER BY %s %s
            %s %s",
            $joins,
            ($where) ? $where : 1,
            'a.'. $sortby,
            $sortdirection,
            ($limit) ? sprintf("LIMIT %d", $limit) : '',
            ($start && $limit) ? ', ' . $start : ''
        ));

        if (!is_array($records) || empty($records)) {
            return array();
        }

        $authors = array();

        foreach ($records as $row) {
            $author = new Author;

            foreach ($row as $field => $val) {
                $author->set($field, $val);
            }

            self::$_pool[$author->get('id')] = $author;
            $authors[] = $author;
        }

        return $authors;
    }
public static function fetch($sortby = 'id', $sortdirection = 'ASC', $limit = null, $start = null, $where = null, $joins = null)
    {
        $sortby = is_null($sortby) ? 'id' : Symphony::Database()->cleanValue($sortby);
        $sortdirection = $sortdirection === 'ASC' ? 'ASC' : 'DESC';

        $records = Symphony::Database()->fetch(sprintf(
            "SELECT a.*
            FROM `tbl_authors` AS `a`
            %s
            WHERE %s
            ORDER BY %s %s
            %s %s",
            $joins,
            ($where) ? $where : 1,
            'a.'. $sortby,
            $sortdirection,
            ($limit) ? sprintf("LIMIT %d", $limit) : '',
            ($start && $limit) ? ', ' . $start : ''
        ));

        if (!is_array($records) || empty($records)) {
            return array();
        }

        $authors = array();

        foreach ($records as $row) {
            $author = new Author;

            foreach ($row as $field => $val) {
                $author->set($field, $val);
            }

            self::$_pool[$author->get('id')] = $author;
            $authors[] = $author;
        }

        return $authors;
    }
public static function fetch ( $ sortby = 'id' , $ sortdirection = 'ASC' , $ limit = null , $ start = null , $ where = null , $ joins = null ) { $ sortby = is_null ( $ sortby ) ? 'id' : Symphony :: Database ( ) -> cleanValue ( $ sortby ) ; $ sortdirection = $ sortdirection === 'ASC' ? 'ASC' : 'DESC' ; $ records = Symphony :: Database ( ) -> fetch ( sprintf ( "SELECT a.*
            FROM `tbl_authors` AS `a`
            %s
            WHERE %s
            ORDER BY %s %s
            %s %s" , $ joins , ( $ where ) ? $ where : 1 , 'a.' . $ sortby , $ sortdirection , ( $ limit ) ? sprintf ( "LIMIT %d" , $ limit ) : '' , ( $ start && $ limit ) ? ', ' . $ start : '' ) ) ; if ( ! is_array ( $ records ) || empty ( $ records ) ) { return array ( ) ; } $ authors = array ( ) ; foreach ( $ records as $ row ) { $ author = new Author ; foreach ( $ row as $ field => $ val ) { $ author -> set ( $ field , $ val ) ; } self :: $ _pool [ $ author -> get ( 'id' ) ] = $ author ; $ authors [ ] = $ author ; } return $ authors ; }
The fetch method returns all Authors from Symphony with the option to sort
or limit the output. This method returns an array of Author objects.

@param string $sortby
The field to sort the authors by, defaults to 'id'
@param string $sortdirection
Available values of ASC (Ascending) or DESC (Descending), which refer to the
sort order for the query. Defaults to ASC (Ascending)
@param integer $limit
The number of rows to return
@param integer $start
The offset start point for limiting, maps to the LIMIT {x}, {y} MySQL functionality
@param string $where
Any custom WHERE clauses. The `tbl_authors` alias is `a`
@param string $joins
Any custom JOIN's
@throws DatabaseException
@return array
An array of Author objects. If no Authors are found, an empty array is returned.
The fetch method returns all Authors from Symphony with the option to sort or limit the output . This method returns an array of Author objects .