コード例 #1
0
 public function testGetPostMetaCollection()
 {
     $query = $this->getMockBuilder('Ekino\\WordpressBundle\\Tests\\Manager\\QueryMock')->disableOriginalConstructor()->getMock();
     $this->repository->expects($this->once())->method('getPostMetaQuery')->will($this->returnValue($query));
     $query->expects($this->once())->method('getResult');
     $this->manager->getPostMeta(22, 'test', false);
 }
コード例 #2
0
 /**
  * @param Post $post
  *
  * @return string
  */
 public function getThumbnailPath(Post $post)
 {
     if (!($thumbnailPostMeta = $this->postMetaManager->getThumbnailPostId($post))) {
         return '';
     }
     /** @var $post Post */
     if (!($post = $this->find($thumbnailPostMeta->getValue()))) {
         return '';
     }
     return $post->getGuid();
 }
コード例 #3
0
 /**
  * @param int $postId
  * @param string $metaName
  * @param bool $fetchOneResult
  *
  * @return array|\Ekino\WordpressBundle\Entity\PostMeta
  */
 public function getPostMeta($postId, $metaName, $fetchOneResult = false)
 {
     return $this->postMetaManager->getPostMeta($postId, $metaName, $fetchOneResult);
 }