From 7c5b900bd83b6b9bdb5656eb169381ff46f8106a Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 20 Jun 2014 15:41:05 -0300 Subject: First API implementation --- app/Model/Board.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'app/Model/Board.php') diff --git a/app/Model/Board.php b/app/Model/Board.php index 59a98923..09fc5b50 100644 --- a/app/Model/Board.php +++ b/app/Model/Board.php @@ -99,7 +99,7 @@ class Board extends Base foreach (array('title', 'task_limit') as $field) { foreach ($values[$field] as $column_id => $field_value) { - $this->db->table(self::TABLE)->eq('id', $column_id)->update(array($field => $field_value)); + $this->updateColumn($column_id, array($field => $field_value)); } } @@ -108,6 +108,19 @@ class Board extends Base return true; } + /** + * Update a column + * + * @access public + * @param integer $column_id Column id + * @param array $values Form values + * @return boolean + */ + public function updateColumn($column_id, array $values) + { + return $this->db->table(self::TABLE)->eq('id', $column_id)->update($values); + } + /** * Move a column down, increment the column position value * -- cgit v1.2.3