Neos\Flow\Mvc\Routing\RouterCachingService::convertObjectsToHashes PHP Method

convertObjectsToHashes() protected method

Recursively converts objects in an array to their identifiers
protected convertObjectsToHashes ( array $routeValues ) : array
$routeValues array the array to be processed
return array the modified array or NULL if $routeValues contain an object and its identifier could not be determined
    protected function convertObjectsToHashes(array $routeValues)
    {
        foreach ($routeValues as &$value) {
            if (is_object($value)) {
                if ($value instanceof CacheAwareInterface) {
                    $identifier = $value->getCacheEntryIdentifier();
                } else {
                    $identifier = $this->persistenceManager->getIdentifierByObject($value);
                }
                if ($identifier === null) {
                    return null;
                }
                $value = $identifier;
            } elseif (is_array($value)) {
                $value = $this->convertObjectsToHashes($value);
                if ($value === null) {
                    return null;
                }
            }
        }
        return $routeValues;
    }