Checks if the group is enabled in a guild.
@param string|\CharlotteDunois\Yasmin\Models\Guild|null  $guild  The guild instance or the guild ID.
@return bool
@throws \InvalidArgumentException
518946
function isEnabledIn($guild) {
        if($guild !== null) {
            $guild = $this->client->guilds->resolve($guild);
            return (!\array_key_exists($guild->id, $this->guildEnabled) || $this->guildEnabled[$guild->id]);
        }
        
        return $this->globalEnabled;
    }
480027
public function getGuildMember4GuildId($guildId)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p', 'character')
            ->join('p.character', 'character')
            ->where('p.guild = :guild')
            ->setParameter('guild', $guildId)
            ->orderBy('p.memberClass', 'asc')
            ->addOrderBy('p.level', 'desc');

        return $query->getQuery()->getResult();
    }
993835
protected function has($key, $cfg = null) {
        if (!$cfg)
            $cfg = $this->cfg;
        return array_key_exists($key, $cfg);
    }
1276267
public function checkDomain()
    {
        // parent
        if ($this->group && ! $this->group->checkDomain())
            return false;

        if ($this->domain === null)
            return true;

        $domain = empty($_SERVER['SERVER_NAME']) ? null : $_SERVER['SERVER_NAME'];
        if ($domain === null)
            return false;

        return $domain === $this->domain;
    }
940525
public function hasAnyTags($tags, string $group = null, string $locale = null): bool
    {
        $tags = $this->parseTags($tags, $group, $locale);

        return ! $this->tags->pluck('id')->intersect($tags)->isEmpty();
    }
1201062
public function has_slot($slot, $variant = null) {
        if ($variant === null) {
            return isset($this->questionstats[$slot]);
        } else {
            return isset($this->questionstats[$slot]->variantstats[$variant]);
        }
    }
1277602
public function hasRole($roleName, $includeGroup = true)
    {
        $roles = $this->getEntityRoles($includeGroup);
        $roleNames = array_map(function (Role $role) {
            return $role->getName();
        }, $roles);

        return in_array($roleName, $roleNames);
    }
229756
public function hasRole($role)
    {
        $role = strtoupper($role);

        if ($role == 'ROLE_USER') {
            return true;
        }

        if (in_array($role, $this->roles)) {
            return true;
        }

        return false;
    }
96508
public static function isValid($visibility)
    {
        switch ($visibility) {
            case Visibility::TYPE_PRIVATE:
            case Visibility::TYPE_PROTECTED:
            case Visibility::TYPE_PUBLIC:
                return true;
        }
        throw new \InvalidArgumentException('The ' . $visibility . ' is not allowed');
    }
1008093
public function canSeePv($gid = null)
    {
        $result = false;
        if (is_null($gid)) {
            $gid = $this->session->getCustomerGroupId();
        }
        if (!isset($this->cacheCanSeeByGid[$gid])) {
            $item = $this->daoPvCustGroup->getById($gid);
            if ($item) $result = (bool)$item->getCanSeePv();
            $this->cacheCanSeeByGid[$gid] = $result;
        } else {
            $result = $this->cacheCanSeeByGid[$gid];
        }
        return $result;
    }
1288411
protected function guardGroup(&$guardGroup)
    {
        $s = $this->seek();
        $guardGroup = array();
        while ($this->guard($guard)) {
            $guardGroup[] = $guard;
            if (!$this->literal('and')) {
                break;
            }
        }

        if (count($guardGroup) == 0) {
            $guardGroup = null;
            $this->seek($s);

            return false;
        }

        return true;
    }
939190
public function hasGroup($group)
    {
        if (is_string($group)) {
            return $this->groups->contains('name', $group);
        }

        return ! ! $group->intersect($this->groups)->count();
    }
341661
public function isInGroup($groupName): bool
    {
        if ($this->group && ($this->group->slug == $this->taggingUtility->slug($groupName))) {
            return true;
        }
        return false;
    }
938098
public function hasRole($role)
    {
        foreach ($this->roles as $roleObj) {
            if($role == $roleObj->getRole()){
                return true;
            }
        }
        return false;
    }
612553
public function getConfigurable($group = null)
    {
        if (empty($this->configurable)) {
            foreach ($this->customfields as $category => $customfield) {
                foreach ($customfield as $field) {
                    if (!$field->configurable()) {
                        continue;
                    }
                    $this->configurable[strtolower(last(explode('\\', $category)))][] = $field->getName();
                }
            }
        }
        return !is_null($group) ? array_get($this->configurable, $group, []) : $this->configurable;
    }
905214
public function hasRole($role)
    {
        if ($this->user() === null) {
            return null;
        }

        return in_array($role, $this->roles, true);
    }
501950
function getGuildPrefix(?\CharlotteDunois\Yasmin\Models\Guild $guild = null) {
        if($guild !== null && $this->provider !== null) {
            try {
                $prefix = $this->provider->get($guild, 'commandPrefix', 404);
                if($prefix !== 404 && $prefix !== '') {
                    return $prefix;
                }
            } catch (\BadMethodCallException $e) {
                return $this->commandPrefix;
            }
        }
        
        return $this->commandPrefix;
    }