CommonITILObject::countUsers PHP Метод

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

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