Gets an array of all the virtual capabilities
@return array Virtual capabilities in format "name => value"
324944
public function getAll()
    {
        $all = array();
        foreach (self::$virtual_capabilities as $name => $class) {
            $all[$name] = $this->get($name);
        }
        return $all;
    }
97850
public function toArray()
    {
        return array(

            'namespace'            => $this->namespace,
            'className'            => $this->className,
            'fileName'             => $this->fileName,
            'callableName'         => $this->callableName,
            'description'          => $this->description,
            'service'              => $this->service,
            'servers'              => $this->servers,
            'iterations'           => $this->iterations,
            'minimumExecutionTime' => $this->minimumExecutionTime,
            'timeout'              => $this->timeout,
            'jobs'                 => $this->jobCollection->toArray(),
        );
    }
436107
public function getDimensions(): array
    {
        if ($this->dimensions === null) {
            $attrs = $this->getXmlAttrs();

            $this->dimensions = [
                (float) $attrs->width ?? 0,
                (float) $attrs->height ?? 0,
            ];
        }

        return $this->dimensions;
    }
1295956
private function getActiveHandlers()
    {
        $handlers = [];
        foreach ($this->handlers as $keyword => $handler) {
            if (array_key_exists($keyword, $this->capabilities)) {
                $handlers[] = $handler;
            }
        }

        return $handlers;
    }
1274387
public function getOperations()
    {
        $result = [];
        foreach ($this->definition['operations'] as $name => $definition) {
            $result[$name] = $this->getOperation($name);
        }

        return $result;
    }
1000446
private function getParentModules(): array
    {
        if (! isset($this->capabilities['action'][Utils::getTypeParent()])) {
            return [];
        }

        $result = [];
        foreach ($this->capabilities['action'][Utils::getTypeParent()] as $capability) {
            if (in_array($capability->getName(), $this->capabilities['user'])) {
                $result = $capability->getParentModules();
            }
        }

        return $result;
    }
131350
public function toArray()
    {
        $result = [
            'name' => $this->init['name'],
            'apiVersion' => $this->init['apiVersion'],
            'baseUri' => isset($this->init['baseUri']) ? $this->init['baseUri'] : '',
            'description' => $this->init['description'],
        ];
        $result['operations'] = $this->operations;
        if (!empty($this->models)) {
            $result['models'] = $this->models;
        }

        return array_filter($result);
    }
614618
public function toArray()
    {
        return [
            'name' => $this->name,
            'class-name' => $this->className,
            'path' => $this->path,
            'is-create' => $this->isCreate,
            'is-virtual' => $this->isVirtual,
            'is-organized' => $this->isOrganized,
            'with-soft-delete' => $this->withSoftDelete,
            'without-timestamps' => $this->withoutTimestamps,
            'resource' => ($this->resource ?: new Resource())->toArray(),
        ];
    }
87386
public function getManagedAbilities(): Collection
    {
        $abilities = $this->isA('superadmin') ? app('cortex.auth.ability')->all() : $this->getAbilities();

        return $abilities->groupBy('entity_type')->map->pluck('title', 'id')->sortKeys();
    }
577225
public function getDesiredCapabilities()
	{
		$capabilities = parent::getDesiredCapabilities();

		if ( !isset($capabilities['platform']) ) {
			$capabilities['platform'] = 'Windows 7';
		}

		if ( !isset($capabilities['version']) ) {
			$capabilities['version'] = '';
		}

		return $capabilities;
	}
1152898
public function getEnabledExtensions()
    {
        $enabled = [];
        $extensions = $this->getExtensions();

        foreach ($this->getEnabled() as $id) {
            if (isset($extensions[$id])) {
                $enabled[$id] = $extensions[$id];
            }
        }

        return $enabled;
    }
915078
public function getVirtualFields()
    {
        // Check if copied page exists
        $record = $this->CopyContentFrom();
        if (!$record || !$record->exists()) {
            return array();
        }

        // Diff db with non-virtual fields
        $fields = array_keys(static::getSchema()->fieldSpecs($record));
        $nonVirtualFields = $this->getNonVirtualisedFields();
        return array_diff($fields, $nonVirtualFields);
    }
1033415
public function getAll()
    {
        $result = $this->wsClient->invokeOperation('listtypes', [ ], 'GET');
        $modules = $result[ 'types' ];

        $result = array();
        foreach ($modules as $moduleName) {
            $result[ $moduleName ] = [ 'name' => $moduleName ];
        }
        return $result;
    }
1066665
public function getObject($name)
    {
        if (!array_key_exists($name, $this->cache)) {
            if (($pos = strpos(self::$virtual_capabilities[$name], '.')) !== false) {
                // Group of capabilities
                list($group, $property) = explode('.', self::$virtual_capabilities[$name]);
                
                if (!array_key_exists($group, $this->group_cache)) {
                    $class = "WURFL_VirtualCapability_{$group}Group";
                    // Cache the group
                    $this->group_cache[$group] = new $class($this->device, $this->request);
                    $this->group_cache[$group]->compute();
                }
                
                // Cache the capability
                $this->cache[$name] = $this->group_cache[$group]->get($property);
            } else {
                // Individual capability
                $class = 'WURFL_VirtualCapability_'.self::$virtual_capabilities[$name];
                $this->cache[$name] = new $class($this->device, $this->request);
            }
        }
        return $this->cache[$name];
    }
735017
public function get_capabilities() {
        global $DB;

        $sort = 'ORDER BY contextlevel,component,name';   // To group them sensibly for display

        $params = array();
        $bi = $DB->get_record('block_instances', array('id' => $this->_instanceid));

        $extra = '';
        $extracaps = block_method_result($bi->blockname, 'get_extra_capabilities');
        if ($extracaps) {
            list($extra, $params) = $DB->get_in_or_equal($extracaps, SQL_PARAMS_NAMED, 'cap');
            $extra = "OR name $extra";
        }

        $sql = "SELECT *
                  FROM {capabilities}
                 WHERE (contextlevel = ".CONTEXT_BLOCK."
                       AND component = :component)
                       $extra";
        $params['component'] = 'block_' . $bi->blockname;

        return $DB->get_records_sql($sql.' '.$sort, $params);
    }
1015098
public function getAll()
    {
        return array(
            self::DEVELOPMENT => self::DEVELOPMENT,
            self::TESTING     => self::TESTING,
            self::STAGING     => self::STAGING,
            self::PRODUCTION  => self::PRODUCTION,
            );
    }
815498
public function toArray()
    {
        $result = [];

        if (!empty($this->name) && empty($this->version)) {
            return $this->name;
        }

        if (!empty($this->name)) {
            $result['name'] = $this->name;
        }

        if (!empty($this->version)) {
            $result['version'] = $this->version->toArray();
        }

        return $result;
    }