public static function getMembersList($query = null)
    {
        if (null === $query || !is_string($query)) {
            return Json::encode(['results' => []]);
        }

        $cache = Podium::getInstance()->podiumCache->getElement('members.fieldlist', $query);
        if ($cache === false) {
            $users = static::find()->where(['and',
                ['status' => self::STATUS_ACTIVE],
                ['!=', 'id', static::loggedId()],
                ['like', 'username', $query]
            ]);
            $users->orderBy(['username' => SORT_ASC, 'id' => SORT_ASC]);
            $results = ['results' => []];
            foreach ($users->each() as $user) {
                $results['results'][] = ['id' => $user->id, 'text' => $user->getPodiumTag(true)];
            }
            if (empty($results['results'])) {
                return Json::encode(['results' => []]);
            }
            $cache = Json::encode($results);
            Podium::getInstance()->podiumCache->setElement('members.fieldlist', $query, $cache);
        }
        return $cache;
    }
public static function getMembersList($query = null)
    {
        if (null === $query || !is_string($query)) {
            return Json::encode(['results' => []]);
        }

        $cache = Podium::getInstance()->podiumCache->getElement('members.fieldlist', $query);
        if ($cache === false) {
            $users = static::find()->where(['and',
                ['status' => self::STATUS_ACTIVE],
                ['!=', 'id', static::loggedId()],
                ['like', 'username', $query]
            ]);
            $users->orderBy(['username' => SORT_ASC, 'id' => SORT_ASC]);
            $results = ['results' => []];
            foreach ($users->each() as $user) {
                $results['results'][] = ['id' => $user->id, 'text' => $user->getPodiumTag(true)];
            }
            if (empty($results['results'])) {
                return Json::encode(['results' => []]);
            }
            $cache = Json::encode($results);
            Podium::getInstance()->podiumCache->setElement('members.fieldlist', $query, $cache);
        }
        return $cache;
    }
public static function getMembersList ( $ query = null ) { if ( null === $ query || ! is_string ( $ query ) ) { return Json :: encode ( [ 'results' => [ ] ] ) ; } $ cache = Podium :: getInstance ( ) -> podiumCache -> getElement ( 'members.fieldlist' , $ query ) ; if ( $ cache === false ) { $ users = static :: find ( ) -> where ( [ 'and' , [ 'status' => self :: STATUS_ACTIVE ] , [ '!=' , 'id' , static :: loggedId ( ) ] , [ 'like' , 'username' , $ query ] ] ) ; $ users -> orderBy ( [ 'username' => SORT_ASC , 'id' => SORT_ASC ] ) ; $ results = [ 'results' => [ ] ] ; foreach ( $ users -> each ( ) as $ user ) { $ results [ 'results' ] [ ] = [ 'id' => $ user -> id , 'text' => $ user -> getPodiumTag ( true ) ] ; } if ( empty ( $ results [ 'results' ] ) ) { return Json :: encode ( [ 'results' => [ ] ] ) ; } $ cache = Json :: encode ( $ results ) ; Podium :: getInstance ( ) -> podiumCache -> setElement ( 'members.fieldlist' , $ query , $ cache ) ; } return $ cache ; }
Returns JSON list of members matching query.
@param string $query
@return string
@since 0.2
Returns JSON list of members matching query .