Neos\Flow\Mvc\Routing\DynamicRoutePart::resolve PHP Метод

resolve() закрытый публичный Метод

If a corresponding element is found in $routeValues, this element is removed from the array.
final public resolve ( array &$routeValues ) : boolean
$routeValues array An array with key/value pairs to be resolved by Dynamic Route Parts.
Результат boolean TRUE if current Route Part could be resolved, otherwise FALSE
    public final function resolve(array &$routeValues)
    {
        $this->value = null;
        if ($this->name === null || $this->name === '') {
            return false;
        }
        $valueToResolve = $this->findValueToResolve($routeValues);
        if (!$this->resolveValue($valueToResolve)) {
            return false;
        }
        $routeValues = Arrays::unsetValueByPath($routeValues, $this->name);
        return true;
    }

Usage Example

 /**
  * @test
  */
 public function routePartValueIsNullAfterUnsuccessfulResolve()
 {
     $this->dynamicRoutPart->setName('foo');
     $routeValues = ['foo' => 'bar'];
     $this->assertTrue($this->dynamicRoutPart->resolve($routeValues));
     $routeValues = [];
     $this->assertFalse($this->dynamicRoutPart->resolve($routeValues));
     $this->assertNull($this->dynamicRoutPart->getValue(), 'Dynamic Route Part value should be NULL when call to resolve() was not successful.');
 }