/** * Return number of users that have this role * * @param void * @return integer */ function getUsersCount() { if ($this->users_count === false) { if ($this->getType() == ROLE_TYPE_SYSTEM) { $this->users_count = Users::countByRole($this); } else { $this->users_count = ProjectUsers::countByRole($this); } // if } // if return $this->users_count; }