function select( $table, $options = array() ) {

        $options = array_merge( array(

            'expr' => null,
            'where' => array(),
            'orderBy' => array(),
            'limitCount' => null,
            'limitOffset' => null,
            'params' => array()

        ), $options );

        $query = "SELECT ";

        if ( empty( $options[ 'expr' ] ) ) {

            $query .= "*";

        } else if ( is_array( $options[ 'expr' ] ) ) {

            $query .= implode( ", ", $options[ 'expr' ] );

        } else {

            $query .= $options[ 'expr' ];

        }

        $table = $this->rewriteTable( $table );
        $query .= " FROM " . $this->quoteIdentifier( $table );

        $query .= $this->getSuffix( $options[ 'where' ], $options[ 'orderBy' ], $options[ 'limitCount' ], $options[ 'limitOffset' ] );

        $this->onQuery( $query, $options[ 'params' ] );

        $statement = $this->prepare( $query );
        $statement->setFetchMode( \PDO::FETCH_ASSOC );
        $statement->execute( $options[ 'params' ] );

        return $statement;

    }
function select( $table, $options = array() ) {

        $options = array_merge( array(

            'expr' => null,
            'where' => array(),
            'orderBy' => array(),
            'limitCount' => null,
            'limitOffset' => null,
            'params' => array()

        ), $options );

        $query = "SELECT ";

        if ( empty( $options[ 'expr' ] ) ) {

            $query .= "*";

        } else if ( is_array( $options[ 'expr' ] ) ) {

            $query .= implode( ", ", $options[ 'expr' ] );

        } else {

            $query .= $options[ 'expr' ];

        }

        $table = $this->rewriteTable( $table );
        $query .= " FROM " . $this->quoteIdentifier( $table );

        $query .= $this->getSuffix( $options[ 'where' ], $options[ 'orderBy' ], $options[ 'limitCount' ], $options[ 'limitOffset' ] );

        $this->onQuery( $query, $options[ 'params' ] );

        $statement = $this->prepare( $query );
        $statement->setFetchMode( \PDO::FETCH_ASSOC );
        $statement->execute( $options[ 'params' ] );

        return $statement;

    }
function select ( $ table , $ options = array ( ) ) { $ options = array_merge ( array ( 'expr' => null , 'where' => array ( ) , 'orderBy' => array ( ) , 'limitCount' => null , 'limitOffset' => null , 'params' => array ( ) ) , $ options ) ; $ query = "SELECT " ; if ( empty ( $ options [ 'expr' ] ) ) { $ query .= "*" ; } else if ( is_array ( $ options [ 'expr' ] ) ) { $ query .= implode ( ", " , $ options [ 'expr' ] ) ; } else { $ query .= $ options [ 'expr' ] ; } $ table = $ this -> rewriteTable ( $ table ) ; $ query .= " FROM " . $ this -> quoteIdentifier ( $ table ) ; $ query .= $ this -> getSuffix ( $ options [ 'where' ] , $ options [ 'orderBy' ] , $ options [ 'limitCount' ] , $ options [ 'limitOffset' ] ) ; $ this -> onQuery ( $ query , $ options [ 'params' ] ) ; $ statement = $ this -> prepare ( $ query ) ; $ statement -> setFetchMode ( \ PDO :: FETCH_ASSOC ) ; $ statement -> execute ( $ options [ 'params' ] ) ; return $ statement ; }
Select rows from a table

@param string $table
@param mixed $exprs
@param array $where
@param array $orderBy
@param int|null $limitCount
@param int|null $limitOffset
@param array $params
@return \PDOStatement
Select rows from a table