summaryrefslogtreecommitdiff
path: root/app/Model/Group.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
commite9fedf3e5cd63aea4da7a71f6647ee427c62fa49 (patch)
treeabc2de5aebace4a2d7c94805552264dab6b10bc7 /app/Model/Group.php
parent346b8312e5ac877ce3192c2db3a26b500018bbb5 (diff)
Rewrite of the authentication and authorization system
Diffstat (limited to 'app/Model/Group.php')
-rw-r--r--app/Model/Group.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/Model/Group.php b/app/Model/Group.php
index 82a8887b..36171ca4 100644
--- a/app/Model/Group.php
+++ b/app/Model/Group.php
@@ -44,6 +44,18 @@ class Group extends Base
}
/**
+ * Get a specific group by external id
+ *
+ * @access public
+ * @param integer $external_id
+ * @return array
+ */
+ public function getByExternalId($external_id)
+ {
+ return $this->getQuery()->eq('external_id', $external_id)->findOne();
+ }
+
+ /**
* Get all groups
*
* @access public
@@ -55,6 +67,18 @@ class Group extends Base
}
/**
+ * Search groups by name
+ *
+ * @access public
+ * @param string $input
+ * @return array
+ */
+ public function search($input)
+ {
+ return $this->db->table(self::TABLE)->ilike('name', '%'.$input.'%')->findAll();
+ }
+
+ /**
* Remove a group
*
* @access public