class MapEvent in Sophron 8
Defines the MapEvent.
Hierarchy
- class \Drupal\sophron\Event\MapEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of MapEvent
2 files declare their use of MapEvent
- MimeMapManager.php in src/
MimeMapManager.php - SophronEventSubscriber.php in src/
EventSubscriber/ SophronEventSubscriber.php
File
- src/
Event/ MapEvent.php, line 10
Namespace
Drupal\sophron\EventView source
class MapEvent extends Event {
/**
* Fires when a MimeMap map is initialized in Sophron.
*
* @Event
*
* @var string
*/
const INIT = 'sophron.map.initialize';
/**
* The MimeMap class being processed.
*
* @var string
*/
protected $mapClass;
/**
* An array of errors collected by the event.
*
* @var array
*/
protected $errors = [];
/**
* Constructs the object.
*
* @param string $map_class
* The MimeMap class being processed.
*/
public function __construct($map_class) {
$this->mapClass = $map_class;
}
/**
* Returns the MimeMap class being processed.
*
* @return string
* The MimeMap class being processed.
*/
public function getMapClass() {
return $this->mapClass;
}
/**
* Adds an error.
*
* @param string $method
* An identifier of the method where the error occurred.
* @param array $args
* An array of arguments passed to the method.
* @param string $type
* An identifier of the type of the error.
* @param string $message
* A messagge detailing the error.
*/
public function addError($method, array $args, $type, $message) {
$this->errors[] = [
'method' => $method,
'args' => $args,
'type' => $type,
'message' => $message,
];
return $this;
}
/**
* Returns the errors collected during the processing of the event.
*
* @return array
* The array of errors collected.
*/
public function getErrors() {
return $this->errors;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MapEvent:: |
protected | property | An array of errors collected by the event. | |
MapEvent:: |
protected | property | The MimeMap class being processed. | |
MapEvent:: |
public | function | Adds an error. | |
MapEvent:: |
public | function | Returns the errors collected during the processing of the event. | |
MapEvent:: |
public | function | Returns the MimeMap class being processed. | |
MapEvent:: |
constant | Fires when a MimeMap map is initialized in Sophron. | ||
MapEvent:: |
public | function | Constructs the object. |