function ZfExtensionManagerSfContainer::setStandalone

Same name in this branch
  1. 9 core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php \Drupal\Component\Bridge\ZfExtensionManagerSfContainer::setStandalone()
Same name in other branches
  1. 8.9.x core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php \Drupal\Component\Bridge\ZfExtensionManagerSfContainer::setStandalone()

Parameters

$class: The class to set as standalone.

File

core/modules/aggregator/src/ZfExtensionManagerSfContainer.php, line 123

Class

ZfExtensionManagerSfContainer
Defines a bridge between the Laminas service manager to Symfony container.

Namespace

Drupal\aggregator

Code

public function setStandalone($class) {
    if (!is_subclass_of($class, ReaderManagerInterface::class) && !is_subclass_of($class, WriterManagerInterface::class)) {
        throw new \RuntimeException("{$class} must implement Laminas\\Feed\\Reader\\ExtensionManagerInterface or Laminas\\Feed\\Writer\\ExtensionManagerInterface");
    }
    $this->standalone = new $class();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.