#[Package('core')]
class QueryStringParser{ /**
* @param array<string, mixed> $query
*/
public static function fromArray(EntityDefinition
$definition, array
$query, SearchRequestException
$exception, string
$path = ''
): Filter
{ if (empty($query['type'
])) { throw DataAbstractionLayerException::
invalidFilterQuery('Value for filter type is required.'
);
} switch ($query['type'
]) { case 'equals':
if (empty($query['field'
])) { throw DataAbstractionLayerException::
invalidFilterQuery('Parameter "field" for equals filter is missing.',
$path . '/field'
);
} if (!\
array_key_exists('value',
$query) ||
$query['value'
] === ''
) { throw DataAbstractionLayerException::
invalidFilterQuery('Parameter "value" for equals filter is missing.',
$path . '/value'
);
}