diff options
Diffstat (limited to 'app/Filter/ProjectUserRoleUsernameFilter.php')
-rw-r--r-- | app/Filter/ProjectUserRoleUsernameFilter.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/Filter/ProjectUserRoleUsernameFilter.php b/app/Filter/ProjectUserRoleUsernameFilter.php new file mode 100644 index 00000000..c00493a3 --- /dev/null +++ b/app/Filter/ProjectUserRoleUsernameFilter.php @@ -0,0 +1,41 @@ +<?php + +namespace Kanboard\Filter; + +use Kanboard\Core\Filter\FilterInterface; +use Kanboard\Model\User; + +/** + * Filter ProjectUserRole users by username + * + * @package filter + * @author Frederic Guillot + */ +class ProjectUserRoleUsernameFilter extends BaseFilter implements FilterInterface +{ + /** + * Get search attribute + * + * @access public + * @return string[] + */ + public function getAttributes() + { + return array(); + } + + /** + * Apply filter + * + * @access public + * @return FilterInterface + */ + public function apply() + { + $this->query + ->join(User::TABLE, 'id', 'user_id') + ->ilike(User::TABLE.'.username', $this->value.'%'); + + return $this; + } +} |