Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Component / Plugin / Discovery / DiscoveryCachedTrait.php
1 <?php
2
3 namespace Drupal\Component\Plugin\Discovery;
4
5 trait DiscoveryCachedTrait {
6
7   use DiscoveryTrait;
8
9   /**
10    * Cached definitions array.
11    *
12    * @var array
13    */
14   protected $definitions;
15
16   /**
17    * {@inheritdoc}
18    */
19   public function getDefinition($plugin_id, $exception_on_invalid = TRUE) {
20     // Fetch definitions if they're not loaded yet.
21     if (!isset($this->definitions)) {
22       $this->getDefinitions();
23     }
24
25     return $this->doGetDefinition($this->definitions, $plugin_id, $exception_on_invalid);
26   }
27
28 }