Return the arc element (such as labelArc) corresponding to the supplied arc role (such as concept-label)
@param string $arcrole
@return boolean|null
428093
public static function standardArcroleArcElement( $arcrole )
	{
		$arcRoles = array(
			self::$arcRoleConceptLabel		=> "labelArc",
			self::$arcRoleConceptReference	=> "referenceArc",
			self::$arcRoleFactFootnote		=> "footnoteArc",
			self::$arcRoleParentChild		=> "presentationArc",
			self::$arcRoleSummationItem		=> "calculationArc",
			self::$arcRoleGeneralSpecial	=> "definitionArc",
			self::$arcRoleEssenceAlias		=> "definitionArc",
			self::$arcRoleSimilarTuples		=> "definitionArc",
			self::$arcRoleRequiresElement	=> "definitionArc",
		);

		return isset( $arcRoles[ $arcrole ] ) ? $arcRoles[ $arcrole ] : null;
	}
1076745
public function getRoleForSite($idSite)
    {
        if ($this->hasSuperUserAccess
            || in_array($idSite, $this->getSitesIdWithAdminAccess())
        ) {
            return 'admin';
        }

        if (in_array($idSite, $this->getSitesIdWithWriteAccess())) {
            return 'write';
        }

        if (in_array($idSite, $this->getSitesIdWithViewAccess())) {
            return 'view';
        }

        return 'noaccess';
    }
1145630
public function retriveAttributeType(\DOMElement $element)
    {
        $name = $this->engine->query($element->getNodePath() . '/dia:attribute[@name="type"]/dia:string');
        return $this->cleanString($name->item(0)->nodeValue);
    }
250393
public function _labelBlankNodes($namer, $element) {
    if(is_array($element)) {
      $length = count($element);
      for($i = 0; $i < $length; ++$i) {
        $element[$i] = $this->_labelBlankNodes($namer, $element[$i]);
      }
    } else if(self::_isList($element)) {
      $element->{'@list'} = $this->_labelBlankNodes(
        $namer, $element->{'@list'});
    } else if(is_object($element)) {
      // rename blank node
      if(self::_isBlankNode($element)) {
        $name = null;
        if(property_exists($element, '@id')) {
          $name = $element->{'@id'};
        }
        $element->{'@id'} = $namer->getName($name);
      }

      // recursively apply to all keys
      $keys = array_keys((array)$element);
      sort($keys);
      foreach($keys as $key) {
        if($key !== '@id') {
          $element->{$key} = $this->_labelBlankNodes($namer, $element->{$key});
        }
      }
    }

    return $element;
  }
885598
protected static function getProperties(DOMElement $element)
	{
		return (isset(self::$htmlElements[$element->nodeName])) ? self::$htmlElements[$element->nodeName] : self::$htmlElements['span'];
	}
745829
private function getRoleRepository()
    {
        if (null === $this->roleRepo) {
            $this->roleRepo = $this->getRepository(RoleInterface::class);
        }

        return $this->roleRepo;
    }
1003628
protected function getRole($roleName)
    {
        if (isset($this->roles[$roleName])) {
            return $this->roles[$roleName];
        }

        // If no config, we create a simple role with no permission
        if (!isset($this->rolesConfig[$roleName])) {
            $role = new Role($roleName);
            $this->roles[$roleName] = $role;
            return $role;
        }

        $roleConfig = $this->rolesConfig[$roleName];

        if (isset($roleConfig['children'])) {
            $role = new HierarchicalRole($roleName);
            $childRoles = (array)$roleConfig['children'];
            foreach ($childRoles as $childRole) {
                $childRole = $this->getRole($childRole);
                $role->addChild($childRole);
            }
        } else {
            $role = new Role($roleName);
        }

        $permissions = isset($roleConfig['permissions']) ? $roleConfig['permissions'] : [];
        foreach ($permissions as $permission) {
            $role->addPermission($permission);
        }

        $this->roles[$roleName] = $role;

        return $role;
    }
1321476
public function getArcroleTypes( $href = null )
	{
		if ( $href === null )
			return $this->arcroleTypes;
		else
		{
			$taxonomy = $this->getTaxonomyForXSD( $href );
			return ( $taxonomy === false )
				? false
				: $taxonomy->getArcroleTypes();
		}
	}
486112
public function getLabel(array $context = null)
    {
        if ($this->getFamily()->hasAttribute('label')) {
            return $this->getValueData($this->getAttribute('label'), $context);
        }
        $label = null;
        try {
            $label = $this->getLabelValue($context);
        } catch (\Exception $e) {
        }
        if (null === $label && $this->getIdentifier()) {
            $label = "[{$this->getIdentifier()}]";
        }

        return $label;
    }
1116771
protected function getListRole()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->role->getList(array('limit' => $this->getLimit()));
        }

        if (empty($id) || !is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->role->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
811924
public function getGenericLabel( $searchRole, $searchLabel = null, $searchLang = null, $linkPath = null )
	{
		if ( ! isset( $this->genericRoles['roles'] ) ) return false;

		$results = array();

		if ( ! isset( $this->genericRoles['roles'][ $searchRole ]['labels'] ) ) return $results;

		foreach ( $this->genericRoles['roles'][ $searchRole ]['labels'] as $linkbase => $labels )
		{
			foreach ( $labels as $label => $langs )
			{
				if ( ! is_null( $searchLabel ) && $label != $searchLabel ) continue;

				foreach ( $langs['lang'] as $lang => $text )
				{
					if ( ! is_null( $searchLang ) && $lang != $searchLang ) continue;

					$results[ $label ] = array(
						'linkbase' => $linkbase,
						'label' => $label,
						'lang' => $lang,
						'text' => isset( $text[ $linkPath ] ) ? $text[ $linkPath] : reset( $text ),
					);
				}

				if ( ! is_null( $searchLabel ) )
				{
					return $results;
				}
			}
		}

		return $results;
	}
197854
public function getRole($role = null)
    {
        /* @var $roleItem RoleInterface */
        foreach ($this->roles as $roleItem) {
            if ($role == $roleItem->getRole()) {
                return $roleItem;
            }
        }

        return null;
    }
494884
public function getAcl(string $idRole = null, string $idResource = null): array
    {
        if ($idRole) {
            $callback = function ($row) use ($idRole, $idResource) {
                if ($idRole && $idResource) {
                    return $row['id_role'] == $idRole && $row['id_resource'] == $idResource;
                }
                if ($idRole) {
                    return $row['id_role'] == $idRole;
                }
                return true;
            };
            return array_filter($this->acl, $callback);
        }
        return $this->acl;
    }
1175596
public function getRoleAsString()
  {
  	$options = self::getRoleOptions();
  	return isset($options[$this->role]) ? $options[$this->role] : '';
  }
482928
protected function getValueFromElement(DOMElement $element)
	{
		return (!$element->attributes->length && $element->childNodes->length === 1 && $element->firstChild->nodeType === XML_TEXT_NODE)
		     ? $element->nodeValue
		     : $this->getElementConfig($element);
	}
520252
private function getRequestedRole()
    {
        $uri = $_SERVER['REQUEST_URI'];

        if( $this->root != '/' && substr( $uri, 0, strlen($this->root) ) === $this->root )
        {
            $uri = substr( $uri, strlen( $this->root ) );
        }

        $questionMarkPosition = strpos( $uri, '?' );
        if( $questionMarkPosition !== false )
        {
            $uri = substr( $uri, 0, $questionMarkPosition );
        }

        return $uri;
    }
358704
public function getRole(ConnectionInterface $con = null)
    {
        if ($this->aRole === null && ($this->role_id !== null)) {
            $this->aRole = ChildRoleQuery::create()->findPk($this->role_id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aRole->addUserRoles($this);
             */
        }

        return $this->aRole;
    }