CommonITILObject::countGroups PHP Метод

countGroups() публичный Метод

count groups linked to object by type or global
public countGroups ( $type ) : integer
$type type to search (see constants) / 0 for all (default 0)
Результат integer
    function countGroups($type = 0)
    {
        if ($type > 0) {
            if (isset($this->groups[$type])) {
                return count($this->groups[$type]);
            }
        } else {
            if (count($this->groups)) {
                $count = 0;
                foreach ($this->groups as $u) {
                    $count += count($u);
                }
                return $count;
            }
        }
        return 0;
    }
CommonITILObject