From c2f8e1c4360cbdd0c740b747d017034d97d8e053 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 16 Feb 2014 18:47:11 -0500 Subject: Improve webhook to add a task --- models/board.php | 6 ++++++ models/project.php | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'models') diff --git a/models/board.php b/models/board.php index 66e6998f..3142a7cc 100644 --- a/models/board.php +++ b/models/board.php @@ -88,6 +88,12 @@ class Board extends Base return $columns; } + // Get first column id for a given project + public function getFirstColumn($project_id) + { + return $this->db->table(self::TABLE)->eq('project_id', $project_id)->asc('position')->findOneColumn('id'); + } + // Get list of columns public function getColumnsList($project_id) { diff --git a/models/project.php b/models/project.php index 7a0fb2b1..b0c2b2ca 100644 --- a/models/project.php +++ b/models/project.php @@ -16,6 +16,11 @@ class Project extends Base return $this->db->table(self::TABLE)->eq('id', $project_id)->findOne(); } + public function getFirst() + { + return $this->db->table(self::TABLE)->findOne(); + } + public function getAll($fetch_stats = false) { if (! $fetch_stats) { -- cgit v1.2.3