From 28ff8dad91c9e3c25f6a3b5398ae15f2a1ef95cd Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 10 Sep 2014 16:21:47 +0200 Subject: Add subtasks and comments history --- app/Controller/Base.php | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'app/Controller/Base.php') diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 4f920ab0..00bfb79b 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -28,6 +28,8 @@ use Model\LastLogin; * @property \Model\SubTask $subTask * @property \Model\Task $task * @property \Model\TaskHistory $taskHistory + * @property \Model\CommentHistory $commentHistory + * @property \Model\SubtaskHistory $subtaskHistory * @property \Model\User $user * @property \Model\Webhook $webhook */ @@ -131,11 +133,29 @@ abstract class Base } // Attach events - $this->action->attachEvents(); - $this->project->attachEvents(); - $this->webhook->attachEvents(); - $this->notification->attachEvents(); - $this->taskHistory->attachEvents(); + $this->attachEvents(); + } + + /** + * Attach events + * + * @access private + */ + private function attachEvents() + { + $models = array( + 'action', + 'project', + 'webhook', + 'notification', + 'taskHistory', + 'commentHistory', + 'subtaskHistory', + ); + + foreach ($models as $model) { + $this->$model->attachEvents(); + } } /** -- cgit v1.2.3