1

我正试图解决 FPNTagBundle 的问题。这是 DoctrineExtensions-Taggable 的集成。我已经按照安装说明中的说明设置了所有内容,并且标记工作正常,保存和加载。

我现在正在尝试为给定的 tag/tag_type 加载所有资源,并且遇到了一些问题。

在 DoctrineExtensions-Taggable 中有一个TagRepository.php使用以下方法:

/**
* Returns an array of ids (e.g. Post ids) for a given taggable
* type that have the given tag
*/
public function getResourceIdsForTag($taggableType, $tag)  

我的标签实体extends \FPN\TagBundle\Entity\Tag;

FPN\标签实体extends DoctrineExtensions\Taggable\Entity\Tag

当我调用以下内容时:

$tagRepo = $em->getRepository('SixStringPearBundle:Tag');
$ids = $tagRepo->getResourceIdsForTag('icon_type', $tag);

我收到以下错误:

Undefined method 'getResourceIdsForTag'. The method name must start with either findBy or findOneBy! 

如果我将其更改为:$em->getRepository('DoctrineExtensions\Taggable\Entity\Tag');

我收到以下错误: The class 'DoctrineExtensions\Taggable\Entity\Tag' was not found in the chain configured namespaces SixString\PearBundle\Entity, FOS\UserBundle\Entity, FPN\TagBundle\Entity

有没有办法访问这个存储库?我可以简单地在我的 Bundle 中创建一个新的 Repo 并复制代码,但我觉得有更好的方法。

另外,为什么在我的捆绑包中找不到该课程?它在 FPN 标记类中加载了 findextends

4

0 回答 0