X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fparagraphs%2Fsrc%2FParagraphsBehaviorCollection.php;fp=web%2Fmodules%2Fcontrib%2Fparagraphs%2Fsrc%2FParagraphsBehaviorCollection.php;h=0000000000000000000000000000000000000000;hp=6f3e0d118bd292301a21ed82957e37b5f3f1c1ea;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/paragraphs/src/ParagraphsBehaviorCollection.php b/web/modules/contrib/paragraphs/src/ParagraphsBehaviorCollection.php deleted file mode 100644 index 6f3e0d118..000000000 --- a/web/modules/contrib/paragraphs/src/ParagraphsBehaviorCollection.php +++ /dev/null @@ -1,71 +0,0 @@ -getAll(); - $enabled = []; - foreach ($this->getConfiguration() as $key => $value) { - if (isset($value['enabled']) && $value['enabled'] == TRUE) { - $enabled[$key] = $this->get($key); - } - } - return $enabled; - } - - /** - * Retrieves all behavior plugins definitions and creates an instance for each - * one. - */ - public function getAll() { - // Retrieve all available behavior plugin definitions. - if (!$this->definitions) { - $this->definitions = $this->manager->getDefinitions(); - } - // Ensure that there is an instance of all available behavior plugins. - // Note that getDefinitions() are keyed by $plugin_id. $instance_id is the - // $plugin_id for behavior plugins, since a single behavior plugin can only - // exist once in a paragraphs type. - foreach ($this->definitions as $plugin_id => $definition) { - if (!isset($this->pluginInstances[$plugin_id])) { - $this->initializePlugin($plugin_id); - } - } - return $this->pluginInstances; - } - - /** - * {@inheritdoc} - */ - protected function initializePlugin($instance_id) { - $configuration = isset($this->configurations[$instance_id]) ? $this->configurations[$instance_id] : []; - $this->set($instance_id, $this->manager->createInstance($instance_id, $configuration)); - } - -}