public function filterByLanguagePresets($queryResult, array $presets) {
    $result = $queryResult;

    if (!empty($presets)) {
      $sysLanguageUid = $this->languageService->getSysLanguageUid();
      $preset         = intval($presets[$sysLanguageUid]);

      if (isset($preset)) {
        $result = [];

        foreach ($queryResult as $object) {
          $uid = $object->getSysLanguageUid();

          if (isset($uid) && $uid == $preset) {
            $result[] = $object;
          }
        }
      }
    }

    return $result;
  }
public function filterByLanguagePresets($queryResult, array $presets) {
    $result = $queryResult;

    if (!empty($presets)) {
      $sysLanguageUid = $this->languageService->getSysLanguageUid();
      $preset         = intval($presets[$sysLanguageUid]);

      if (isset($preset)) {
        $result = [];

        foreach ($queryResult as $object) {
          $uid = $object->getSysLanguageUid();

          if (isset($uid) && $uid == $preset) {
            $result[] = $object;
          }
        }
      }
    }

    return $result;
  }
public function filterByLanguagePresets ( $ queryResult , array $ presets ) { $ result = $ queryResult ; if ( ! empty ( $ presets ) ) { $ sysLanguageUid = $ this -> languageService -> getSysLanguageUid ( ) ; $ preset = intval ( $ presets [ $ sysLanguageUid ] ) ; if ( isset ( $ preset ) ) { $ result = [ ] ; foreach ( $ queryResult as $ object ) { $ uid = $ object -> getSysLanguageUid ( ) ; if ( isset ( $ uid ) && $ uid == $ preset ) { $ result [ ] = $ object ; } } } } return $ result ; }
Filters a query result by language presets.

@param object $queryResult The query result
@param array $presets The language presets
@return object The filtered query result
Filters a query result by language presets .