src/Laito/Database.php
public function count($column)
    {
        // Set a really hight limit
        $this->limit(pow(100, 3));

        // Select only the COUNT column and get
        $result = $this->select(['COUNT(' . $this->table . '.' . $column .') as count'])->get();

        // Reset
        $this->reset();

        // Return number of records
        return (count($result) === 1)? (int) reset($result)['count'] : count($result);
    }
public function count($column)
    {
        // Set a really hight limit
        $this->limit(pow(100, 3));

        // Select only the COUNT column and get
        $result = $this->select(['COUNT(' . $this->table . '.' . $column .') as count'])->get();

        // Reset
        $this->reset();

        // Return number of records
        return (count($result) === 1)? (int) reset($result)['count'] : count($result);
    }
public function count ( $ column ) { // Set a really hight limit $ this -> limit ( pow ( 100 , 3 ) ) ; // Select only the COUNT column and get $ result = $ this -> select ( [ 'COUNT(' . $ this -> table . '.' . $ column . ') as count' ] ) -> get ( ) ; // Reset $ this -> reset ( ) ; // Return number of records return ( count ( $ result ) === 1 ) ? ( int ) reset ( $ result ) [ 'count' ] : count ( $ result ) ; }
Performs a SELECT COUNT query

@param string $column Column to count by
@return int Number of rows matching the SELECT query
Performs a SELECT COUNT query