From 963273575f74f6c25cac50a135ee5c2a6bd92e31 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 2 May 2015 09:01:27 +0930 Subject: [PATCH] Assign user input to data property on EditDiscussionCommand --- framework/core/src/Core/Commands/EditDiscussionCommand.php | 5 +++-- .../Core/Handlers/Commands/EditDiscussionCommandHandler.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/core/src/Core/Commands/EditDiscussionCommand.php b/framework/core/src/Core/Commands/EditDiscussionCommand.php index ffdd2d5c7..f986daa12 100644 --- a/framework/core/src/Core/Commands/EditDiscussionCommand.php +++ b/framework/core/src/Core/Commands/EditDiscussionCommand.php @@ -6,11 +6,12 @@ class EditDiscussionCommand public $user; - public $title; + public $data; - public function __construct($discussionId, $user) + public function __construct($discussionId, $user, $data) { $this->discussionId = $discussionId; $this->user = $user; + $this->data = $data; } } diff --git a/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php b/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php index 4f8ab6f1c..49c1b8ec0 100644 --- a/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php +++ b/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php @@ -22,8 +22,8 @@ class EditDiscussionCommandHandler $discussion->assertCan($user, 'edit'); - if (isset($command->title)) { - $discussion->rename($command->title, $user); + if (isset($command->data['title'])) { + $discussion->rename($command->data['title'], $user); } event(new DiscussionWillBeSaved($discussion, $command));