public function match(array $url, array $context = [])
    {
        if (empty($this->_compiledRoute)) {
            $this->compile();
        }

        if (isset($url['_entity'])) {
            $entity = $url['_entity'];
            $this->_checkEntity($entity);

            foreach ($this->keys as $field) {
                if (!isset($url[$field]) && isset($entity[$field])) {
                    $url[$field] = $entity[$field];
                }
            }
        }

        return parent::match($url, $context);
    }
public function match(array $url, array $context = [])
    {
        if (empty($this->_compiledRoute)) {
            $this->compile();
        }

        if (isset($url['_entity'])) {
            $entity = $url['_entity'];
            $this->_checkEntity($entity);

            foreach ($this->keys as $field) {
                if (!isset($url[$field]) && isset($entity[$field])) {
                    $url[$field] = $entity[$field];
                }
            }
        }

        return parent::match($url, $context);
    }
public function match ( array $ url , array $ context = [ ] ) { if ( empty ( $ this -> _compiledRoute ) ) { $ this -> compile ( ) ; } if ( isset ( $ url [ '_entity' ] ) ) { $ entity = $ url [ '_entity' ] ; $ this -> _checkEntity ( $ entity ) ; foreach ( $ this -> keys as $ field ) { if ( ! isset ( $ url [ $ field ] ) && isset ( $ entity [ $ field ] ) ) { $ url [ $ field ] = $ entity [ $ field ] ; } } } return parent :: match ( $ url , $ context ) ; }
Match by entity and map its fields to the URL pattern by comparing the
field names with the template vars.

If a routing key is defined in both `$url` and the entity, the value defined
in `$url` will be preferred.

@param array $url Array of parameters to convert to a string.
@param array $context An array of the current request context.
Contains information such as the current host, scheme, port, and base
directory.
@return bool|string Either false or a string URL.
Match by entity and map its fields to the URL pattern by comparing the field names with the template vars .