コード例 #1
0
 public function getView(View $view)
 {
     if (($configHash = $this->matcherFactory->match($view)) === null) {
         return null;
     }
     return $this->buildContentView($configHash);
 }
コード例 #2
0
 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));
 }
コード例 #3
0
ファイル: CommentsRenderer.php プロジェクト: ataxel/tp
 /**
  * @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' );
 }
コード例 #4
0
ファイル: TagViewProvider.php プロジェクト: umanit/TagsBundle
 /**
  * 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);
     }
 }
コード例 #5
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)
 {
     $view = new ContentView(null, [], 'comments');
     $view->setContent($this->contentService->loadContentByContentInfo($contentInfo));
     return $this->matcherFactory->match($view);
 }