Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 9 |
| MissingContentEvent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 9 |
| __construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getMissingContent | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| resolveMissingContent | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 5 |
|||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\Core\Config\Importer\MissingContentEvent. | |
| */ | |
| namespace Drupal\Core\Config\Importer; | |
| use Symfony\Component\EventDispatcher\Event; | |
| /** | |
| * Wraps a configuration event for event listeners. | |
| * | |
| * @see \Drupal\Core\Config\Config\ConfigEvents::IMPORT_MISSING_CONTENT | |
| */ | |
| class MissingContentEvent extends Event { | |
| /** | |
| * A list of missing content dependencies. | |
| * | |
| * @var array | |
| */ | |
| protected $missingContent; | |
| /** | |
| * Constructs a configuration import missing content event object. | |
| * | |
| * @param array $missing_content | |
| * Missing content information. | |
| */ | |
| public function __construct(array $missing_content) { | |
| $this->missingContent = $missing_content; | |
| } | |
| /** | |
| * Gets missing content information. | |
| * | |
| * @return array | |
| * A list of missing content dependencies. The array is keyed by UUID. Each | |
| * value is an array with the following keys: 'entity_type', 'bundle' and | |
| * 'uuid'. | |
| */ | |
| public function getMissingContent() { | |
| return $this->missingContent; | |
| } | |
| /** | |
| * Resolves the missing content by removing it from the list. | |
| * | |
| * @param string $uuid | |
| * The UUID of the content entity to mark resolved. | |
| * | |
| * @return $this | |
| * The MissingContentEvent object. | |
| */ | |
| public function resolveMissingContent($uuid) { | |
| if (isset($this->missingContent[$uuid])) { | |
| unset($this->missingContent[$uuid]); | |
| } | |
| return $this; | |
| } | |
| } |