class ContentParsedEvent in YAML Content 8
Same name and namespace in other branches
- 8.2 src/Event/ContentParsedEvent.php \Drupal\yaml_content\Event\ContentParsedEvent
Wraps a yaml content content parsed event for event listeners.
Hierarchy
- class \Drupal\yaml_content\Event\EventBase extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\yaml_content\Event\ContentParsedEvent
Expanded class hierarchy of ContentParsedEvent
1 file declares its use of ContentParsedEvent
- ContentLoader.php in src/
ContentLoader/ ContentLoader.php
File
- src/
Event/ ContentParsedEvent.php, line 10
Namespace
Drupal\yaml_content\EventView source
class ContentParsedEvent extends EventBase {
/**
* The full file path for the file that was parsed.
*
* @var string
*/
protected $contentFile;
/**
* The parsed content from the file prepared for import.
*
* @var array
*/
protected $parsedContent;
/**
* Constructs a yaml content content parsed event object.
*
* @param \Drupal\yaml_content\ContentLoader\ContentLoaderInterface $loader
* The active Content Loader that triggered the event.
* @param string $content_file
* The full file path for the content file that was parsed.
* @param array $parsed_content
* The parsed content loaded from the content file.
*/
public function __construct(ContentLoaderInterface $loader, $content_file, array $parsed_content) {
parent::__construct($loader);
$this->contentFile = $content_file;
$this->parsedContent = $parsed_content;
}
/**
* Gets the file path of the content file that was loaded.
*
* @return string
* The file path for the content file that was loaded.
*/
public function getContentFile() {
return $this->contentFile;
}
/**
* Gets the parsed content loaded from the content file.
*
* @return array
* The parsed content structure interpreted from the content file.
*/
public function getParsedContent() {
return $this->parsedContent;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentParsedEvent:: |
protected | property | The full file path for the file that was parsed. | |
ContentParsedEvent:: |
protected | property | The parsed content from the file prepared for import. | |
ContentParsedEvent:: |
public | function | Gets the file path of the content file that was loaded. | |
ContentParsedEvent:: |
public | function | Gets the parsed content loaded from the content file. | |
ContentParsedEvent:: |
public | function |
Constructs a yaml content content parsed event object. Overrides EventBase:: |
|
EventBase:: |
protected | property | The ContentLoader being actively executed and triggering the event. | |
EventBase:: |
public | function | Gets the ContentLoader object that triggered the event. |