Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Config / ConfigImporterEvent.php
1 <?php
2
3 namespace Drupal\Core\Config;
4
5 use Symfony\Component\EventDispatcher\Event;
6
7 class ConfigImporterEvent extends Event {
8   /**
9    * Configuration import object.
10    *
11    * @var \Drupal\Core\Config\ConfigImporter
12    */
13   protected $configImporter;
14
15   /**
16    * Constructs ConfigImporterEvent.
17    *
18    * @param \Drupal\Core\Config\ConfigImporter $config_importer
19    *   A config import object to notify listeners about.
20    */
21   public function __construct(ConfigImporter $config_importer) {
22     $this->configImporter = $config_importer;
23   }
24
25   /**
26    * Gets the config import object.
27    *
28    * @return \Drupal\Core\Config\ConfigImporter
29    *   The ConfigImporter object.
30    */
31   public function getConfigImporter() {
32     return $this->configImporter;
33   }
34
35   /**
36    * Gets the list of changes that will be imported.
37    *
38    * @param string $op
39    *   (optional) A change operation. Either delete, create or update. If
40    *   supplied the returned list will be limited to this operation.
41    * @param string $collection
42    *   (optional) The collection to get the changelist for. Defaults to the
43    *   default collection.
44    *
45    * @return array
46    *   An array of config changes that are yet to be imported.
47    *
48    * @see \Drupal\Core\Config\StorageComparerInterface::getChangelist()
49    */
50   public function getChangelist($op = NULL, $collection = StorageInterface::DEFAULT_COLLECTION) {
51     return $this->configImporter->getStorageComparer()->getChangelist($op, $collection);
52   }
53
54 }