From 11858be4e8d5aba983700c6cba1c4d0a33ea8e9d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 9 Apr 2016 22:42:17 -0400 Subject: Filter refactoring --- app/Model/TaskFinder.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'app/Model/TaskFinder.php') diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php index 7bca2284..1840b505 100644 --- a/app/Model/TaskFinder.php +++ b/app/Model/TaskFinder.php @@ -362,6 +362,27 @@ class TaskFinder extends Base return $rq->fetch(PDO::FETCH_ASSOC); } + /** + * Get iCal query + * + * @access public + * @return \PicoDb\Table + */ + public function getICalQuery() + { + return $this->db->table(Task::TABLE) + ->left(User::TABLE, 'ua', 'id', Task::TABLE, 'owner_id') + ->left(User::TABLE, 'uc', 'id', Task::TABLE, 'creator_id') + ->columns( + Task::TABLE.'.*', + 'ua.email AS assignee_email', + 'ua.name AS assignee_name', + 'ua.username AS assignee_username', + 'uc.email AS creator_email', + 'uc.username AS creator_username' + ); + } + /** * Count all tasks for a given project and status * -- cgit v1.2.3