src/Zicht/Bundle/UrlBundle/Aliasing/Aliaser.php
public function createAlias($record, $action = ['VIEW'])
    {
        $internalUrl = $this->provider->url($record);

        if (in_array($internalUrl, $this->recursionProtection)) {
            return false;
        }

        $this->recursionProtection[] = $internalUrl;

        if ($this->shouldGenerateAlias($record, $action)) {
            // Don't save an alias if the generated public alias is null
            if (null !== ($generatedAlias = $this->aliasingStrategy->generatePublicAlias($record))) {
                return $this->aliasing->addAlias(
                    $generatedAlias,
                    $internalUrl,
                    UrlAlias::REWRITE,
                    $this->conflictingPublicUrlStrategy,
                    $this->conflictingInternalUrlStrategy
                );
            }
        }

        return false;
    }
public function createAlias($record, $action = ['VIEW'])
    {
        $internalUrl = $this->provider->url($record);

        if (in_array($internalUrl, $this->recursionProtection)) {
            return false;
        }

        $this->recursionProtection[] = $internalUrl;

        if ($this->shouldGenerateAlias($record, $action)) {
            // Don't save an alias if the generated public alias is null
            if (null !== ($generatedAlias = $this->aliasingStrategy->generatePublicAlias($record))) {
                return $this->aliasing->addAlias(
                    $generatedAlias,
                    $internalUrl,
                    UrlAlias::REWRITE,
                    $this->conflictingPublicUrlStrategy,
                    $this->conflictingInternalUrlStrategy
                );
            }
        }

        return false;
    }
public function createAlias ( $ record , $ action = [ 'VIEW' ] ) { $ internalUrl = $ this -> provider -> url ( $ record ) ; if ( in_array ( $ internalUrl , $ this -> recursionProtection ) ) { return false ; } $ this -> recursionProtection [ ] = $ internalUrl ; if ( $ this -> shouldGenerateAlias ( $ record , $ action ) ) { // Don't save an alias if the generated public alias is null if ( null !== ( $ generatedAlias = $ this -> aliasingStrategy -> generatePublicAlias ( $ record ) ) ) { return $ this -> aliasing -> addAlias ( $ generatedAlias , $ internalUrl , UrlAlias :: REWRITE , $ this -> conflictingPublicUrlStrategy , $ this -> conflictingInternalUrlStrategy ) ; } } return false ; }
Create an alias for the provided object.

@param mixed $record
@param array $action
@return bool Whether or not an alias was created.
Create an alias for the provided object .