eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\DoctrineDatabase::countTypesInGroup PHP Method

countTypesInGroup() public method

Returns the number of types in a certain group.
public countTypesInGroup ( integer $groupId ) : integer
$groupId integer
return integer
    public function countTypesInGroup($groupId)
    {
        $q = $this->dbHandler->createSelectQuery();
        $q->select($q->alias($q->expr->count($this->dbHandler->quoteColumn('contentclass_id')), 'count'))->from($this->dbHandler->quoteTable('ezcontentclass_classgroup'))->where($q->expr->eq($this->dbHandler->quoteColumn('group_id'), $q->bindValue($groupId, null, \PDO::PARAM_INT)));
        $stmt = $q->prepare();
        $stmt->execute();
        return (int) $stmt->fetchColumn();
    }