original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Returns JSON list of members matching query.
  @param string $query
  @return string
  @since 0.2
docstring_tokens: Returns JSON list of members matching query .