mirror of
https://github.com/PGYER/codefever.git
synced 2026-05-07 22:18:21 +08:00
28 lines
544 B
PHP
Executable File
28 lines
544 B
PHP
Executable File
<?php
|
|
|
|
namespace service\EventHandler;
|
|
|
|
use service\Event\Event;
|
|
|
|
abstract class EventHandler {
|
|
|
|
protected $CI;
|
|
|
|
public function __construct(Event $event = NULL) {
|
|
|
|
if ($event) {
|
|
$eventTypes = explode(':', $event->eventType);
|
|
if(isset($eventTypes[1])) {
|
|
$instruction = 'on' . ucfirst($eventTypes[1]);
|
|
$this->$instruction($event);
|
|
}
|
|
}
|
|
|
|
$this->CI =& get_instance();
|
|
}
|
|
|
|
public function __call($name, $args) {
|
|
// do nothing
|
|
}
|
|
}
|