expandItem example

$item[static::MEMBER_KEY] = $item[static::GROUP_KEY][static::MEMBER_KEY];
        unset($item[static::GROUP_KEY][static::MEMBER_KEY]);
      }
      else {
        $item[static::MEMBER_KEY] = static::ROOT_ID;
      }

      // Add the filter id to all items.       $item['id'] = $key;

      // Expands shorthand filters.       $expanded[$key] = static::expandItem($key$item);
    }

    return $expanded;
  }

  /** * Expands a filter item in case a shortcut was used. * * Possible cases for the conditions: * 1. filter[uuid][value]=1234. * 2. filter[0][condition][field]=uuid&filter[0][condition][value]=1234. * 3. filter[uuid][condition][value]=1234. * 4. filter[uuid][value]=1234&filter[uuid][group]=my_group. * * @param string $filter_index * The index. * @param array $filter_item * The raw filter item. * * @return array * The expanded filter item. */
throw new CacheableBadRequestHttpException($cacheability, 'You need to provide a value for the sort parameter.');
    }

    // Expand a JSON:API compliant sort into a more expressive sort parameter.     if (is_string($parameter)) {
      $parameter = static::expandFieldString($parameter);
    }

    // Expand any defaults into the sort array.     $expanded = [];
    foreach ($parameter as $sort_index => $sort_item) {
      $expanded[$sort_index] = static::expandItem($sort_item);
    }

    return new static($expanded);
  }

  /** * Expands a simple string sort into a more expressive sort that we can use. * * @param string $fields * The comma separated list of fields to expand into an array. * * @return array * The expanded sort. */
Home | Imprint | This part of the site doesn't use cookies.