PartKeepr\DoctrineReflectionBundle\Filter\AdvancedSearchFilter::getFilterValueFromUrl PHP Method

getFilterValueFromUrl() private method

Gets the ID from an URI or a raw ID.
private getFilterValueFromUrl ( string $value ) : string
$value string
return string
    private function getFilterValueFromUrl($value)
    {
        if (is_array($value)) {
            $items = [];
            foreach ($value as $iri) {
                try {
                    if ($item = $this->iriConverter->getItemFromIri($iri)) {
                        $items[] = $this->propertyAccessor->getValue($item, 'id');
                    } else {
                        $items[] = $iri;
                    }
                } catch (\InvalidArgumentException $e) {
                    $items[] = $iri;
                }
            }
            return $items;
        }
        try {
            if ($item = $this->iriConverter->getItemFromIri($value)) {
                return $this->propertyAccessor->getValue($item, 'id');
            }
        } catch (\InvalidArgumentException $e) {
            // Do nothing, return the raw value
        }
        return $value;
    }