Fire/Sql/Collection.php
public function count($filter = null)
    {
        if (is_null($filter)) {
            return $this->_countObjectsInCollection();
        } else if (is_string($filter)) {
            json_decode($filter);
            $isJson = (json_last_error() === JSON_ERROR_NONE) ? true :false;
            if ($isJson) {
                $filter = new Filter($filter);
                return $this->_countObjectsInCollectionByFilter($filter);
            }
        } else if (is_object($filter) && $filter instanceof Filter) {
            return $this->_countObjectsInCollectionByFilter($filter);
        }
        return 0;
    }
public function count($filter = null)
    {
        if (is_null($filter)) {
            return $this->_countObjectsInCollection();
        } else if (is_string($filter)) {
            json_decode($filter);
            $isJson = (json_last_error() === JSON_ERROR_NONE) ? true :false;
            if ($isJson) {
                $filter = new Filter($filter);
                return $this->_countObjectsInCollectionByFilter($filter);
            }
        } else if (is_object($filter) && $filter instanceof Filter) {
            return $this->_countObjectsInCollectionByFilter($filter);
        }
        return 0;
    }
public function count ( $ filter = null ) { if ( is_null ( $ filter ) ) { return $ this -> _countObjectsInCollection ( ) ; } else if ( is_string ( $ filter ) ) { json_decode ( $ filter ) ; $ isJson = ( json_last_error ( ) === JSON_ERROR_NONE ) ? true : false ; if ( $ isJson ) { $ filter = new Filter ( $ filter ) ; return $ this -> _countObjectsInCollectionByFilter ( $ filter ) ; } } else if ( is_object ( $ filter ) && $ filter instanceof Filter ) { return $ this -> _countObjectsInCollectionByFilter ( $ filter ) ; } return 0 ; }
Returns the total number of objects in a collection.
@param string|null|Fire\Sql\Filter $filter
@return int
Returns the total number of objects in a collection .