public function count($type, $conditions = null)
    {
        $this->requireRegisteredType($type);

        if ($conditions = $this->connection->prepareConditions($conditions)) {
            return $this->connection->executeFirstCell('SELECT COUNT(`id`) AS "row_count" FROM ' . $this->getTypeTable($type, true) . " WHERE $conditions");
        } else {
            return $this->connection->executeFirstCell('SELECT COUNT(`id`) AS "row_count" FROM ' . $this->getTypeTable($type, true));
        }
    }
public function count($type, $conditions = null)
    {
        $this->requireRegisteredType($type);

        if ($conditions = $this->connection->prepareConditions($conditions)) {
            return $this->connection->executeFirstCell('SELECT COUNT(`id`) AS "row_count" FROM ' . $this->getTypeTable($type, true) . " WHERE $conditions");
        } else {
            return $this->connection->executeFirstCell('SELECT COUNT(`id`) AS "row_count" FROM ' . $this->getTypeTable($type, true));
        }
    }
public function count ( $ type , $ conditions = null ) { $ this -> requireRegisteredType ( $ type ) ; if ( $ conditions = $ this -> connection -> prepareConditions ( $ conditions ) ) { return $ this -> connection -> executeFirstCell ( 'SELECT COUNT(`id`) AS "row_count" FROM ' . $ this -> getTypeTable ( $ type , true ) . " WHERE $conditions" ) ; } else { return $ this -> connection -> executeFirstCell ( 'SELECT COUNT(`id`) AS "row_count" FROM ' . $ this -> getTypeTable ( $ type , true ) ) ; } }
Return number of records of the given type that match the given conditions.

@param  string            $type
@param  array|string|null $conditions
@return int
Return number of records of the given type that match the given conditions .