/** * Counts all associated RoleModules * @return int */ public function CountRoleModules() { if (is_null($this->intRoleId)) { return 0; } return RoleModule::CountByRoleId($this->intRoleId); }