diff options
Diffstat (limited to 'app/Model/Group.php')
-rw-r--r-- | app/Model/Group.php | 24 |
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 |