Gets a Role List of all roles owned by this Customer.
@param bool $force If true forces to reload Role list form the database storage.
@return CNabuRoleList Returns the list of roles.
431805
public function getRoles(bool $force = false)
    {
        if ($this->nb_role_list->isEmpty() || $force) {
            $this->nb_role_list->clear();
            $this->nb_role_list->merge(CNabuRole::getAllRoles($this));
        }

        return $this->nb_role_list;
    }
1054545
public function getTargets($force = false) : CNabuSiteTargetList
    {
        if (!$this->isBuiltIn() &&
            ($this->nb_site_target_list->isEmpty() || $force)
        ) {
            $this->nb_site_target_list->clear();
            $this->nb_site_target_list->merge(CNabuSiteTarget::getAllSiteTargets($this));
            $this->nb_site_target_list->iterate(function ($key, $nb_site_target) {
                $nb_site_target->setSite($this);
                return true;
            });
        }

        return $this->nb_site_target_list;
    }
1194326
public function getProspectStatusTypes(bool $force = false) : CNabuIContactProspectStatusTypeList
    {
        if ($this->nb_icontact_prospect_status_type_list->isEmpty() || $force) {
            $this->nb_icontact_prospect_status_type_list->clear();
            $this->nb_icontact_prospect_status_type_list->merge(CNabuIContactProspectStatusType::getTypesForIContact($this));
        }

        return $this->nb_icontact_prospect_status_type_list;
    }
409764
public function getActiveServices($force = false)
    {
        if ($this->nb_messaging_service_list === null) {
            $this->nb_messaging_service_list = new CNabuMessagingServiceList();
        }

        if ($this->nb_messaging_service_list->isEmpty() || $force) {
            $this->nb_messaging_service_list->clear();
            $this->nb_messaging_service_list->merge(CNabuMessagingService::getActiveMessagingServices($this));
            $this->nb_messaging_service_list->iterate(function($key, CNabuMessagingService $nb_service) {
                $nb_service->setMessaging($this);
                return true;
            });
        }

        return $this->nb_messaging_service_list;
    }
785679
public function getItems($force = false)
    {
        if (!$this->isBuiltIn() && ($this->nb_medioteca_item_list->isEmpty() || $force)) {
            $this->nb_medioteca_item_list = CNabuMediotecaItem::getItemsForMedioteca($this);
        }

        return $this->nb_medioteca_item_list;
    }
104354
public function getRoles($includeAbstract = false)
    {
        $this->initialize();
        if (!$includeAbstract) {
            return array_filter($this->roles, function (Role $role) {
                return $role->isAbstract() !== true;
            });
        }
        return $this->roles;
    }
602599
protected function touch($force = false)
    {
        if (true === $this->getState()->is('deleted')) {
            return $this;
        }
        if (true === $this->getState()->is('empty') || true === $force) {
            $record = $this->store->retrieveRecord($this->getType(), $this->getId());
            $this->initialize($record['properties']);
            $this->getState()->setLoaded();
        }
        return $this;
    }
1038069
protected function getRoles() {
        if (!$this->_roles) {
            $this->_roles = new RoleList($this->version, $this->solution['sid']);
        }

        return $this->_roles;
    }
835667
public function get_extlinks( $force = false ) {

		if( !$force && $this->extlinks !== null ) {
			return $this->extlinks;
		}

		$this->extlinks = array();
		if( !$this->exists ) return array();

		$tArray = array(
			'prop'     => 'extlinks',
			'titles'   => $this->title,
			'_code'    => 'el',
			'_lhtitle' => 'extlinks'
		);

		pecho( "Getting external links used on {$this->title}..\n\n", PECHO_NORMAL );

		$result = $this->wiki->listHandler( $tArray );

		if( count( $result ) > 0 ) {
			foreach( $result as $extlink ){
				$this->extlinks[] = $extlink['*'];
			}
		}

		return $this->extlinks;
	}
96949
public function getPrescriber(bool $force = false)
    {
        if ($this->nb_prescriber == NULL ||
            $this->nb_prescriber->getId() != $this->getPrescriberId() ||
            $force
        ) {
            $nb_prescriber_id = $this->getPrescriberId();
            if ($nb_prescriber_id === null || $this->getCustomer() === null) {
                $this->nb_prescriber = null;
            } else {
                $this->nb_prescriber = $this->getCustomer()->getUser($nb_prescriber_id);
            }
        }

        return $this->nb_prescriber;
    }
824173
public function getMembers($force = false)
    {
        if ($this->nb_user_group_member_list->isEmpty() || $force) {
            $this->nb_user_group_member_list->clear();
            if ($this->isValueNumeric('nb_user_group_id')) {
                $this->nb_user_group_member_list->merge(CNabuUserGroupMember::getMembersOfGroup($this));
            }
        }

        return $this->nb_user_group_member_list;
    }
738444
public function getRolesIdList() {

		$roles		= $this->roleMappingList;
		$rolesList	= array();

		foreach ( $roles as $role ) {

			array_push( $rolesList, $role->roleId );
		}

		return $rolesList;
	}
783546
public function toArray($force = true)
    {
        if (!$force && !$this->hasChildren()) {
            return $this->toValue();
        }

        $data = array();
        foreach ($this->children() as $name => $child) {
            $data[$name] = $child->toArray(false);
        }

        return $data;
    }
1194647
public function getNaturalLanguages(bool $force = false) : CNabuLanguageList
    {
        $nb_natural = new CNabuLanguageList();
        $this->getLanguages($force)->iterate(function ($key, CNabuLanguage $nb_language) use ($nb_natural) {
            if ($nb_language->isNaturalLanguage()) {
                $nb_natural->addItem($nb_language);
            }
            return true;
        });

        return $nb_natural;
    }
517360
static public function getRolesForSite($nb_site) : CNabuRoleList
    {
        $nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID);

        if (is_numeric($nb_site_id)) {
            $retval = self::buildObjectListFromSQL(
                'nb_role_id',
                'select r.* '
                . 'from nb_role r, nb_site_role sr, nb_site s '
               . 'where r.nb_role_id=sr.nb_role_id '
                 . 'and sr.nb_site_id=s.nb_site_id '
                 . 'and s.nb_site_id=%site_id$d',
                array(
                    'site_id' => $nb_site_id
                ),
                ($nb_site instanceof CNabuSite ? $nb_site : null)
            );
        } else {
            $retval = new CNabuRoleList();
        }

        return $retval;
    }
222652
public function getSiteRoles(bool $force = false) : CNabuSiteRoleList
    {
        if ($this->nb_site_role_list->isEmpty() || $force) {
            $this->nb_site_role_list->clear();
            $this->nb_site_role_list->merge(CNabuSiteRole::getSiteRolesForSite($this));
        }

        return $this->nb_site_role_list;
    }
1143546
public function addSelfSelectColumns($force = false)
    {
        if ($this->isSelfSelected && !$force) {
            return $this;
        }

        $tableMap = $this->modelTableMapName;
        $tableMap::addSelectColumns($this, $this->useAliasInSQL ? $this->modelAlias : null);
        $this->isSelfSelected = true;

        return $this;
    }