match() public method

If so, the configuration hash will be returned. $valueObject can be for example a Location or a Content object.
public match ( eZ\Publish\Core\MVC\Symfony\View\View $view ) : array | null
$view eZ\Publish\Core\MVC\Symfony\View\View
return array | null The matched configuration as a hash, containing template or controller to use, or null if not matched.
 public function getView(View $view)
 {
     if (($configHash = $this->matcherFactory->match($view)) === null) {
         return null;
     }
     return $this->buildContentView($configHash);
 }
Beispiel #2
0
 /**
  * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
  *
  * @note Matched config is cached in memory by underlying matcher factory.
  *
  * @return array|null
  */
 private function getCommentsConfig( ContentInfo $contentInfo )
 {
     return $this->matcherFactory->match( $contentInfo, 'comments' );
 }
 /**
  * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
  *
  * @note Matched config is cached in memory by underlying matcher factory.
  *
  * @return array|null
  */
 private function getCommentsConfig(ContentInfo $contentInfo)
 {
     $view = new ContentView(null, [], 'comments');
     $view->setContent($this->contentService->loadContentByContentInfo($contentInfo));
     return $this->matcherFactory->match($view);
 }