summaryrefslogtreecommitdiff
path: root/app/Group/DatabaseBackendGroupProvider.php
blob: 6dbaa43c5ef1577804efb75905a0297edf79d358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

namespace Kanboard\Group;

use Kanboard\Core\Base;
use Kanboard\Core\Group\GroupBackendProviderInterface;

/**
 * Database Backend Group Provider
 *
 * @package  group
 * @author   Frederic Guillot
 */
class DatabaseBackendGroupProvider extends Base implements GroupBackendProviderInterface
{
    /**
     * Find a group from a search query
     *
     * @access public
     * @param  string $input
     * @return DatabaseGroupProvider[]
     */
    public function find($input)
    {
        $result = array();
        $groups = $this->group->search($input);

        foreach ($groups as $group) {
            $result[] = new DatabaseGroupProvider($group);
        }

        return $result;
    }
}