From e9fedf3e5cd63aea4da7a71f6647ee427c62fa49 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 5 Dec 2015 20:31:27 -0500 Subject: Rewrite of the authentication and authorization system --- app/Model/Group.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'app/Model/Group.php') 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 @@ -43,6 +43,18 @@ class Group extends Base return $this->getQuery()->eq('id', $group_id)->findOne(); } + /** + * 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 * @@ -54,6 +66,18 @@ class Group extends Base return $this->getQuery()->asc('name')->findAll(); } + /** + * 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 * -- cgit v1.2.3