public function getView(View $view) { if (($configHash = $this->matcherFactory->match($view)) === null) { return null; } return $this->buildContentView($configHash); }
public function testCanNotCommentContent() { $renderer = $this->createCommentsRenderer(); $contentInfo = new ContentInfo(); $this->matcherFactoryMock->expects($this->once())->method('match')->will($this->returnValue(array('enabled' => false))); $this->assertFalse($renderer->canCommentContent($contentInfo)); }
/** * @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' ); }
/** * Changes the site access. * * @param \eZ\Publish\Core\MVC\Symfony\SiteAccess $siteAccess */ public function setSiteAccess(SiteAccess $siteAccess = null) { if ($this->matcherFactory instanceof SiteAccessAware) { $this->matcherFactory->setSiteAccess($siteAccess); } }
/** * @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); }