Gets role instance path.

@param string               $name     The hosted service name
@param GetDeploymentOptions $options  The get deployment options
@param string               $roleName The role instance name

@return string
553277
private function _getRoleInstancePath($name, GetDeploymentOptions $options, $roleName)
    {
        $path = $this->_getDeploymentPath($name, $options).'/roleinstances';

        return "$path/$roleName";
    }
1030918
private function _getPath($serviceManagementResource, $name)
    {
        $path = $this->_subscriptionId.'/'.$serviceManagementResource;

        if (!is_null($name)) {
            $path .= '/'.$name;
        }

        return $path;
    }
1179659
public static function findByName(string $name, $guardName = null): RoleContract
    {
        $guardName = $guardName ?? Guard::getDefaultName(static::class);

        $role = static::where('name', $name)->where('guard_name', $guardName)->first();

        if (! $role) {
            throw RoleDoesNotExist::named($name);
        }

        return $role;
    }
401619
public function getUserGuidsByRole($roleName)
    {
        if (empty($roleName)) {
            return [];
        }

        return (new Query)->select('[[user_guid]]')
            ->from($this->assignmentTable)
            ->where(['item_name' => $roleName])->column($this->db);
    }
466884
public function findByRoles(array $roleNames)
    {
        $dql = 'SELECT pws from Claroline\CoreBundle\Entity\Tool\PwsToolConfig pws
            JOIN pws.role role
            WHERE role.name IN (:roleNames)
        ';

        $query = $this->_em->createQuery($dql);
        $query->setParameter('roleNames', $roleNames);
        $pwsToolConfigs = $query->getResult();

        $data = [];

        foreach ($pwsToolConfigs as $pwsToolConfig) {
            $data[$pwsToolConfig->getTool()->getId()]['toolConfig'] = $pwsToolConfig;
            if (!isset($data[$pwsToolConfig->getTool()->getId()]['mask']))
                $data[$pwsToolConfig->getTool()->getId()]['mask'] = 0;
            $data[$pwsToolConfig->getTool()->getId()]['mask'] |= $pwsToolConfig->getMask();
        }

        return $data;
    }
1138380
public function modulelist(string $roleName = ''): AnsibleGalaxyInterface
    {
        $this->addBaseoption('list');

        if ('' !== $roleName) {
            $this->addBaseoption($roleName);
        }

        return $this;
    }
705823
public function findUserIdsInRoles($roleNames)
    {
        $qb = $this->createQueryBuilder('user')
            ->select('DISTINCT(user.id) as id')
            ->leftJoin('user.roles', 'roles')
            ->andWhere('roles.name IN (:roleNames)')
            ->andWhere('user.isRemoved = false')
            ->setParameter('roleNames', $roleNames);
        $query = $qb->getQuery();

        return array_column($query->getScalarResult(), 'id');
    }
997233
public function getBelongTo(string $name, string $id): ?RoleInterface
    {
        return $this->belongTo[$name][$id] ?? null;
    }
971907
public function addRole($roleName)
    {
        if (true === is_string($roleName) && false === in_array($roleName, $this->roles)) {
            $this->roles[] = $roleName;
        }
        return $this;
    }
584015
private function getClientOptions(array $options, DeploymentConfig $deploymentConfig)
    {
        $clientOptions = [];

        if (isset($options[self::INPUT_KEY_ES_HOSTS]) || $deploymentConfig->get(self::CONFIG_PATH_ES_HOSTS)) {
            $clientOptions = [
                'servers'           => $this->readConfiguration($options, $deploymentConfig, self::INPUT_KEY_ES_HOSTS),
                'enable_https_mode' => $this->readConfiguration($options, $deploymentConfig, self::INPUT_KEY_ES_SSL),
                'http_auth_user'    => (string) $this->readConfiguration($options, $deploymentConfig, self::INPUT_KEY_ES_USER),
                'http_auth_pwd'     => (string) $this->readConfiguration($options, $deploymentConfig, self::INPUT_KEY_ES_PASS),
            ];

            $clientOptions['enable_http_auth'] = !empty($clientOptions['http_auth_user']) && !empty($clientOptions['http_auth_pwd']);
        }

        return $clientOptions;
    }
624922
private function getOption(string $functionName)
    {
        if (!array_key_exists($functionName, $this->optionsCache)) {
            $this->optionsCache[$functionName] = $this->parentOptions->{$functionName}();
        }

        return $this->optionsCache[$functionName];
    }
311540
public function make($name, $options)
    {
        if (!$name) {
            return null;
        }

        if (strpos($name, __NAMESPACE__) === false) {
            $name = __NAMESPACE__ . '\\' . $name;
        }

        if (isset($this->operationMap[$name])) {
            return $this->operationMap[$name];
        }

        if (!class_exists($name, true)) {
            return null;
        }

        $this->operationMap[$name] = new $name($options);

        return $this->operationMap[$name];
    }
394250
public function getRoleAssigments($roleName) {
        $query = (new Query)->from($this->assignmentTable)
            ->where(['item_name' => $roleName]);

        $assignments = [];
        foreach ($query->all($this->db) as $row) {
            $assignments[$row['user_id']] = new Assignment([
                'userId' => $row['user_id'],
                'roleName' => $row['item_name'],
                'createdAt' => $row['created_at'],
            ]);
        }

        return $assignments;
    }
1197266
public function get($name, $options = [], $usePeeringServiceManagers = false)
    {
        if (is_string($options)) {
            $options = ['class_name' => $options];
        }

        return parent::get($name, $options, $usePeeringServiceManagers);
    }
642341
public static function getRouter($name = null, array $options = array())
    {
        if (!isset($name))
        {
            $app  = \JFactory::getApplication();
            $name = $app->getName();
        }

        try
        {
            $router = \JRouter::getInstance($name, $options);
        }
        catch (\Exception $e)
        {
            return null;
        }

        return $router;
    }
1026395
public function getOption($optionName = null)
    {
        if ($this->multiSite) {
            $options = get_site_option($this->settingsName);
        } else {
            $options = get_option($this->settingsName);
        }
        if (!$optionName)
            return $options;

        if (is_array($options) && isset($options[$optionName]))
            return $options[$optionName];
        foreach ($this->settings as $setting) {
            if ($setting['name'] == $optionName) {
                if (!empty($setting['default']))
                    return $setting['default'];
                break;
            }
        }
        return null;
    }
1235792
public function get($name, $options = null)
    {
        if ($this->has($name)) {
            return $this->resolve($name, $options);
        } else {
            $this->throwNotFound($name);
            return false;
        }
    }