Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
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 } |