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

        $tables  = $this->sqlFrom();
        $filters = $this->sqlFilters();

        $query = 'SELECT COUNT(*) FROM '.$tables.$filters;
        return $query;
    }
public function sqlLoadCount()
    {
        if (!$this->hasTable()) {
            throw new UnexpectedValueException(
                'Can not get SQL count. No table defined.'
            );
        }

        $tables  = $this->sqlFrom();
        $filters = $this->sqlFilters();

        $query = 'SELECT COUNT(*) FROM '.$tables.$filters;
        return $query;
    }
public function sqlLoadCount ( ) { if ( ! $ this -> hasTable ( ) ) { throw new UnexpectedValueException ( 'Can not get SQL count. No table defined.' ) ; } $ tables = $ this -> sqlFrom ( ) ; $ filters = $ this -> sqlFilters ( ) ; $ query = 'SELECT COUNT(*) FROM ' . $ tables . $ filters ; return $ query ; }
Compile the SELECT statement for fetching the number of objects.

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