From 4d007ec39fe808c28fe08516afe549aa5d0aeb42 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 22 Nov 2014 19:15:50 -0500 Subject: addColumn() return the column_id now --- app/Model/Board.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Model/Board.php b/app/Model/Board.php index 4c78b0f6..667bbdbe 100644 --- a/app/Model/Board.php +++ b/app/Model/Board.php @@ -109,16 +109,18 @@ class Board extends Base * @param integer $project_id Project id * @param string $title Column title * @param integer $task_limit Task limit - * @return boolean + * @return boolean|integer */ public function addColumn($project_id, $title, $task_limit = 0) { - return $this->db->table(self::TABLE)->save(array( + $values = array( 'project_id' => $project_id, 'title' => $title, 'task_limit' => $task_limit, 'position' => $this->getLastColumnPosition($project_id) + 1, - )); + ); + + return $this->persist(self::TABLE, $values); } /** -- cgit v1.2.3