欢迎。不可能在 Action 中从存储库中调用其函数(Expressive Zend + Doctrine)
___________________
// App\Entity\Category
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Category
*
* @ORM\Table(name="category", indexes={@ORM\Index(name="id", columns={"id"})})
* @ORM\Entity(repositoryClass="App\Repository\CategoryRepository")
*/
class Category
{//}
___________________
// App\Repository\CategoryRepository
namespace App\Repository;
use Doctrine\ORM\EntityRepository;
class CategoryRepository extends EntityRepository
{
public function finderMethod($arguments){
// Какие-либо действия
return $arguments;
}
}
___________________
// App\Action\PageAction
$category = $this->em->getRepository('App\Entity\Category')-> ???
findAll(), findBy 按预期工作,我做错了什么?(据我记得,在 zf2 中我遇到了同样的问题)