eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\HostText::reverseMatch PHP Метод

reverseMatch() публичный Метод

public reverseMatch ( $siteAccessName )
    public function reverseMatch($siteAccessName)
    {
        $this->request->setHost($this->prefix . $siteAccessName . $this->suffix);
        return $this;
    }

Usage Example

 public function testReverseMatch()
 {
     $matcher = new HostTextMatcher(array("prefix" => "www.", "suffix" => ".com"));
     $matcher->setRequest(new SimplifiedRequest(array('host' => 'www.my_siteaccess.com')));
     $result = $matcher->reverseMatch('foobar');
     $this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Matcher\\HostText', $result);
     $request = $result->getRequest();
     $this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\Routing\\SimplifiedRequest', $request);
     $this->assertSame("www.foobar.com", $request->host);
 }