Move events handling to Symfony\EventDispatcher
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Model;
|
||||
|
||||
use Event\CommentEvent;
|
||||
use SimpleValidator\Validator;
|
||||
use SimpleValidator\Validators;
|
||||
|
||||
@@ -107,7 +108,7 @@ class Comment extends Base
|
||||
$comment_id = $this->persist(self::TABLE, $values);
|
||||
|
||||
if ($comment_id) {
|
||||
$this->event->trigger(self::EVENT_CREATE, array('id' => $comment_id) + $values);
|
||||
$this->container['dispatcher']->dispatch(self::EVENT_CREATE, new CommentEvent(array('id' => $comment_id) + $values));
|
||||
}
|
||||
|
||||
return $comment_id;
|
||||
@@ -127,7 +128,7 @@ class Comment extends Base
|
||||
->eq('id', $values['id'])
|
||||
->update(array('comment' => $values['comment']));
|
||||
|
||||
$this->event->trigger(self::EVENT_UPDATE, $values);
|
||||
$this->container['dispatcher']->dispatch(self::EVENT_UPDATE, new CommentEvent($values));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user