src/Model.php
public function count($with_deleted = null)
    {
        if (false === $this->has_table()) return false;

        if ($this->count === 0) {
            $with_deleted !== null or $with_deleted = (! $this->is_destructive);

            if (false === $with_deleted) {
                $db = $this->db->where($this->deletion_key, 0);
            }

            $this->count = $db->count_all_results($this->table);
        }

        return $this->count;
    }
public function count($with_deleted = null)
    {
        if (false === $this->has_table()) return false;

        if ($this->count === 0) {
            $with_deleted !== null or $with_deleted = (! $this->is_destructive);

            if (false === $with_deleted) {
                $db = $this->db->where($this->deletion_key, 0);
            }

            $this->count = $db->count_all_results($this->table);
        }

        return $this->count;
    }
public function count ( $ with_deleted = null ) { if ( false === $ this -> has_table ( ) ) return false ; if ( $ this -> count === 0 ) { $ with_deleted !== null or $ with_deleted = ( ! $ this -> is_destructive ) ; if ( false === $ with_deleted ) { $ db = $ this -> db -> where ( $ this -> deletion_key , 0 ) ; } $ this -> count = $ db -> count_all_results ( $ this -> table ) ; } return $ this -> count ; }
Count all rows

@param   bool  $with_deleted  Including deleted data?
@return  int
Count all rows