Get the resolved form of an installed extension class.

@param string|null $id The extension ID or composer name

@return ResolvedExtension|null
3729
public function getResolved($id)
    {
        if (isset($this->extensions[$id])) {
            return $this->extensions[$id];
        } elseif (isset($this->composerNames[$id])) {
            $id = (string) $this->composerNames[$id];

            return $this->extensions[$id];
        }

        return null;
    }
78406
public function getModule($id)
    {
        $returnValue = null;

    	$className = $this->getId().'_actions_'.$id;
		if(class_exists($className)) {
			$returnValue = new $className;
		} else {
			common_Logger::e('could not load '.$className);
		}

        return $returnValue;
    }
762990
public function getIdsDependingOn($id)
    {
        $resolved = [];
        $unresolved = [];
        $this->dependencyResolve($id, $resolved, $unresolved);

        return array_keys($resolved);
    }
729360
public function getCampaignEditForm($id)
    {
        // Get record-specific fields
        $record = ChangeSet::get()->byID($id);
        if (!$record) {
            $this->httpError(404);
            return null;
        }
        if (!$record->canView()) {
            $this->httpError(403);
            return null;
        }

        $fields = $record->getCMSFields();

        // Add standard fields
        $fields->push(HiddenField::create('ID'));
        $form = Form::create(
            $this,
            'campaignEditForm',
            $fields,
            FieldList::create(
                FormAction::create('save', _t(__CLASS__.'SAVE', 'Save'))
                    ->setIcon('save')
                    ->setSchemaState([
                        'data' => [
                            'pristineTitle' => _t(__CLASS__.'SAVED', 'Saved'),
                            'pristineIcon' => 'tick',
                            'dirtyTitle' => _t(__CLASS__.'SAVE', 'Save'),
                            'dirtyIcon' => 'save',
                            'pristineClass' => 'btn-outline-primary',
                            'dirtyClass' => '',
                        ],
                    ]),
                FormAction::create('cancel', _t(__CLASS__.'.CANCEL', 'Cancel'))
                    ->setUseButtonTag(true)
            ),
            new RequiredFields('Name')
        );

        // Load into form
        $form->loadDataFrom($record);

        // Set form action handler with ID included
        $form->setRequestHandler(
            LeftAndMainFormRequestHandler::create($form, [ $id ])
        );

        // Configure form to respond to validation errors with form schema
        // if requested via react.
        $form->setValidationResponseCallback(function (ValidationResult $errors) use ($form, $id, $record) {
            $schemaId = Controller::join_links(
                $this->Link('schema'),
                'campaignEditForm',
                $id
            );
            return $this->getSchemaResponse($schemaId, $form, $errors);
        });

        $form->setNotifyUnsavedChanges(true);

        return $form;
    }
281911
public function get($id)
    {
        if ($this->has($id) === false)
        {
            $message = (string) 'Class (%s) does not exists';

            throw new NotFoundException(sprintf($message, $id));
        }

        $reflection = new \ReflectionClass($id);

        if ($constructor = $reflection->getConstructor())
        {
            $arguments = $this->arguments($constructor);

            return $reflection->newInstanceArgs($arguments);
        }

        return new $id;
    }
465240
public function getPluginById($id)
    {
        foreach ($this->plugins as $plugin) {
            if ($plugin::getPluginId() == $id) {
                return $plugin;
            }
        }
    }
1220692
private function resolveInstance(string $id)
    {
        if (Validator::key($id)->validate($this->instances)) {
            return $this->instances[$id];
        }
        return $this->resolveAutomaticResolvable($id);
    }
469541
public function get($id)
    {
        if (!is_string($id)) {
            throw new ContainerException('$id must be a string');
        }

        if (!isset($this->definitions[$id])) {
            throw new NotFoundException("Unresolvable ".$id);
        }

        return $this->definitions[$id];
    }
1042936
protected function getPluginClass($id)
    {
        return isset($this->pluginClasses[$id]) ? $this->pluginClasses[$id] : null;
    }
1014575
private function load($id = null)
    {

        $this->initialize();
        $this->id = $id;
        return $this->getDataConnector()->loadContext($this);

    }
1183150
public function getService($id) {
            if (!isset($this->services[$id])) {
                // TODO: execption
                return null;
            }
            if (is_string($this->services[$id])) {
                $this->services[$id] = $this->container->get($this->services[$id]);
            }

            return $this->services[$id];
        }
493519
@Override
    public Extension resolve(ExtensionId extensionId) throws ResolveException
    {
        try {
            return resolve(extensionId.getId(), extensionId.getVersion());
        } catch (ResourceNotFoundException e) {
            throw new ExtensionNotFoundException("Could not find extension [" + extensionId + "]", e);
        } catch (Exception e) {
            throw new ResolveException("Failed to create extension object for extension [" + extensionId + "]", e);
        }
    }
361956
@Override
    public E resolve(ExtensionId extensionId) throws ResolveException
    {
        E extension = this.extensions.get(extensionId);

        if (extension == null) {
            throw new ExtensionNotFoundException("Can't find extension [" + extensionId + "]");
        }

        return extension;
    }
236839
private function get(String $id)
	{
		if (!$id) {
			$id = ConnectionManager::DEFAULT_CONNECTION_ID;
		}

		if (count($this->loadedConnections) < 1) {
			return false;
		}

		if (isset($this->loadedConnections[$id])) {
			$this->configuredConnectionId = $id;
			$this->platformConnector = [$id => $this->loadedConnections[$id]];
			$connector = new PlatformResolver($this);
			return $connector->resolvePlatform(new EventManager());
		}
	}
895127
protected function getExtensionsForAdmin($id, Definition $admin, ContainerBuilder $container, array $extensionMap)
    {
        $extensions = [];
        $classReflection = $subjectReflection = null;

        $excludes = $extensionMap['excludes'];
        unset($extensionMap['excludes']);

        foreach ($extensionMap as $type => $subjects) {
            foreach ($subjects as $subject => $extensionList) {
                if ('admins' === $type) {
                    if ($id === $subject) {
                        $extensions = array_merge($extensions, $extensionList);
                    }
                } else {
                    $class = $this->getManagedClass($admin, $container);
                    if (!class_exists($class)) {
                        continue;
                    }
                    $classReflection = new \ReflectionClass($class);
                    $subjectReflection = new \ReflectionClass($subject);
                }

                if ('instanceof' === $type) {
                    if ($subjectReflection->getName() === $classReflection->getName() || $classReflection->isSubclassOf($subject)) {
                        $extensions = array_merge($extensions, $extensionList);
                    }
                }

                if ('implements' === $type) {
                    if ($classReflection->implementsInterface($subject)) {
                        $extensions = array_merge($extensions, $extensionList);
                    }
                }

                if ('extends' === $type) {
                    if ($classReflection->isSubclassOf($subject)) {
                        $extensions = array_merge($extensions, $extensionList);
                    }
                }

                if ('uses' === $type) {
                    if ($this->hasTrait($classReflection, $subject)) {
                        $extensions = array_merge($extensions, $extensionList);
                    }
                }
            }
        }

        if (isset($excludes[$id])) {
            $extensions = array_diff_key($extensions, $excludes[$id]);
        }

        return $extensions;
    }
986494
public static function findAvailableModuleById($id)
    {
        $availableModels = static::findAvailableModules();
        return array_key_exists($id, $availableModels) ? $availableModels[$id] : null;
    }
309188
static function get(string $id): ?\BearFramework\Addon
    {
        if (isset(self::$data[$id])) {
            return clone(self::$data[$id]);
        }
        return null;
    }