<?php
 namespace Engine\Plugins; abstract class RegisterAbstract { protected $observers=[]; public function __construct() { $this->register(); } protected function addObserver($triggerName, \Engine\Plugins\Observer $obs) { if (!$triggerName) { throw new \Exception('The trigger name was not set in '.get_called_class().'::'.__FUNCTION__."."); } $this->observers[$triggerName][] = $obs; } abstract protected function register(); public function getObservers() { return $this->observers; } }