src/Charcoal/Loader/CollectionLoader.php
public function loadCount()
    {
        $query = $this->source()->sqlLoadCount();

        $db = $this->source()->db();
        if (!$db) {
            throw new RuntimeException(
                'Could not instanciate a database connection.'
            );
        }
        $this->logger->debug($query);

        $sth = $db->prepare($query);
        $sth->execute();
        $res = $sth->fetchColumn(0);

        return (int)$res;
    }
public function loadCount()
    {
        $query = $this->source()->sqlLoadCount();

        $db = $this->source()->db();
        if (!$db) {
            throw new RuntimeException(
                'Could not instanciate a database connection.'
            );
        }
        $this->logger->debug($query);

        $sth = $db->prepare($query);
        $sth->execute();
        $res = $sth->fetchColumn(0);

        return (int)$res;
    }
public function loadCount ( ) { $ query = $ this -> source ( ) -> sqlLoadCount ( ) ; $ db = $ this -> source ( ) -> db ( ) ; if ( ! $ db ) { throw new RuntimeException ( 'Could not instanciate a database connection.' ) ; } $ this -> logger -> debug ( $ query ) ; $ sth = $ db -> prepare ( $ query ) ; $ sth -> execute ( ) ; $ res = $ sth -> fetchColumn ( 0 ) ; return ( int ) $ res ; }
Get the total number of items for this collection query.

@throws RuntimeException If the database connection fails.
@return integer
Get the total number of items for this collection query .