/** * {@inheritdoc} */ public function __construct(array $configuration, $plugin_id, array $plugin_definition) { // @todo Change key to, e.g., '*index', to avoid potential collisions. if (!empty($configuration['index']) && $configuration['index'] instanceof IndexInterface) { $this->setIndex($configuration['index']); unset($configuration['index']); } parent::__construct($configuration, $plugin_id, $plugin_definition); }
/** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { /** @var static $data_type */ $data_type = parent::create($container, $configuration, $plugin_id, $plugin_definition); /** @var \Drupal\search_api\Backend\BackendPluginManager $backend_manager */ $backend_manager = $container->get('plugin.manager.search_api.backend'); $data_type->setBackendManager($backend_manager); return $data_type; }
/** * Implements the magic __wakeup() method. * * Reloads the server entity. */ public function __wakeup() { parent::__wakeup(); if ($this->serverId) { $this->server = Server::load($this->serverId); $this->serverId = NULL; } }