You are here

public function ParagraphsBehaviorCollection::getEnabled in Paragraphs 8

Retrieves all enabled behavior plugins.

File

src/ParagraphsBehaviorCollection.php, line 31

Class

ParagraphsBehaviorCollection
A collection of paragraphs behavior plugins.

Namespace

Drupal\paragraphs

Code

public function getEnabled() {
  $this
    ->getAll();
  $enabled = [];
  foreach ($this
    ->getConfiguration() as $key => $value) {
    if (isset($value['enabled']) && $value['enabled'] == TRUE) {
      $enabled[$key] = $this
        ->get($key);
    }
  }
  return $enabled;
}