If so, the configuration hash will be returned.
$valueObject can be for example a Location or a Content object.
public function getView(View $view) { if (($configHash = $this->matcherFactory->match($view)) === null) { return null; } return $this->buildContentView($configHash); }
/** * @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); }