2 namespace Civi\ActionSchedule\Event
;
4 use Civi\ActionSchedule\MappingInterface
;
5 use Symfony\Component\EventDispatcher\Event
;
8 * Class ActionScheduleEvent
9 * @package Civi\ActionSchedule\Event
11 * Register any available mappings.
13 class MappingRegisterEvent
extends Event
{
17 * Array(scalar $id => Mapping $mapping).
19 protected $mappings = array();
22 * Register a new mapping.
24 * @param MappingInterface $mapping
28 public function register(MappingInterface
$mapping) {
29 $this->mappings
[$mapping->getId()] = $mapping;
35 * Array(scalar $id => MappingInterface $mapping).
37 public function getMappings() {
38 ksort($this->mappings
);
39 return $this->mappings
;