src/Charcoal/Source/DatabaseSource.php
public function sqlLoad()
    {
        if (!$this->hasTable()) {
            throw new UnexpectedValueException(
                'Can not get SQL SELECT clause. No table defined.'
            );
        }

        $selects = $this->sqlSelect();
        $tables  = $this->sqlFrom();
        $filters = $this->sqlFilters();
        $orders  = $this->sqlOrders();
        $limits  = $this->sqlPagination();

        $query = 'SELECT '.$selects.' FROM '.$tables.$filters.$orders.$limits;
        return $query;
    }
public function sqlLoad()
    {
        if (!$this->hasTable()) {
            throw new UnexpectedValueException(
                'Can not get SQL SELECT clause. No table defined.'
            );
        }

        $selects = $this->sqlSelect();
        $tables  = $this->sqlFrom();
        $filters = $this->sqlFilters();
        $orders  = $this->sqlOrders();
        $limits  = $this->sqlPagination();

        $query = 'SELECT '.$selects.' FROM '.$tables.$filters.$orders.$limits;
        return $query;
    }
public function sqlLoad ( ) { if ( ! $ this -> hasTable ( ) ) { throw new UnexpectedValueException ( 'Can not get SQL SELECT clause. No table defined.' ) ; } $ selects = $ this -> sqlSelect ( ) ; $ tables = $ this -> sqlFrom ( ) ; $ filters = $ this -> sqlFilters ( ) ; $ orders = $ this -> sqlOrders ( ) ; $ limits = $ this -> sqlPagination ( ) ; $ query = 'SELECT ' . $ selects . ' FROM ' . $ tables . $ filters . $ orders . $ limits ; return $ query ; }
Compile the SELECT statement for fetching one or more objects.

@throws UnexpectedValueException If the source does not have a table defined.
@return string
Compile the SELECT statement for fetching one or more objects .