| @@ -215,9 +215,9 @@ | ||
| 215 | 215 | $event = $events[$type->type]; |
| 216 | 216 | // Create subject object! and bind live events! |
| 217 | 217 | $subject = $this->subjects[$event['id']] = $this->createSubject($event); |
| 218 | 218 | // Live events! |
| 219 | - $lives = (array) self::$live[$this->targetClass][$event['id']]; | |
| 219 | + $lives = isset(self::$live[$this->targetClass][$event['id']]) ? self::$live[$this->targetClass][$event['id']] : array(); | |
| 220 | 220 | foreach ($lives as $live) { |
| 221 | 221 | $subject[] = $live['observer']; |
| 222 | 222 | } |
| 223 | 223 | } |
| @@ -229,9 +229,9 @@ | ||
| 229 | 229 | * |
| 230 | 230 | * @param mixed $type |
| 231 | 231 | * @return CJTWordpressEvents |
| 232 | 232 | */ |
| 233 | - public function getTypeEvents($typeName, $typePrefixed = true) { | |
| 233 | + public static function getTypeEvents($typeName, $typePrefixed = true) { | |
| 234 | 234 | $type = self::parseEventType($typeName, $typePrefixed); |
| 235 | 235 | if (!self::$classes[$type->class]) { |
| 236 | 236 | throw new Exception("Type not found!! Could not find {$typeName}!"); |
| 237 | 237 | } |
| @@ -261,9 +261,9 @@ | ||
| 261 | 261 | * |
| 262 | 262 | * @param mixed $typeName |
| 263 | 263 | * @param mixed $observer |
| 264 | 264 | */ |
| 265 | - public function on($typeName, $observer) { | |
| 265 | + public static function on($typeName, $observer) { | |
| 266 | 266 | $type = self::parseEventType($typeName, false); |
| 267 | 267 | // Create live event! |
| 268 | 268 | $on = array(); |
| 269 | 269 | $on['observer'] = $observer; |
| @@ -274,9 +274,9 @@ | ||
| 274 | 274 | * put your comment there... |
| 275 | 275 | * |
| 276 | 276 | * @param mixed $type |
| 277 | 277 | */ |
| 278 | - public function parseEventType($type, $typePrefixed = true) { | |
| 278 | + public static function parseEventType($type, $typePrefixed = true) { | |
| 279 | 279 | $separator = '.'; |
| 280 | 280 | $prefix = 'on'; |
| 281 | 281 | // CLASS.TYPE |
| 282 | 282 | $parts = explode('.', $type); |