removeNotAllowedFields example

$includes = $criteria->getIncludes() ?? [];
        $decoded = $this->filterIncludes($includes$decoded$entity);

        if (isset($decoded['customFields']) && $decoded['customFields'] === []) {
            $decoded['customFields'] = new \stdClass();
        }

        if (isset($decoded['translated']['customFields']) && $decoded['translated']['customFields'] === []) {
            $decoded['translated']['customFields'] = new \stdClass();
        }

        return $this->removeNotAllowedFields($decoded$definition$baseUrl);
    }

    private function filterIncludes(array $includes, array $decoded, Struct $struct): array
    {
        $alias = $struct->getApiAlias();

        foreach ($decoded as $property => $value) {
            if (!$this->propertyAllowed($includes$alias$property)) {
                unset($decoded[$property]);

                continue;
            }
Home | Imprint | This part of the site doesn't use cookies.