-1
欢迎。这是不可能的呼叫从仓库的功能于一身的动作(Zend的表现主义+)在存储库中使用它的函数(Doctrine + Zend表达式)
___________________
// 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我有同样的问题)
你得到什么错误? ***您确定$ this-> em是实体管理器的实例吗?***虽然这不是必需的,尝试在应用程序之前添加反斜杠,例如:** $ this-> em-> getRepository('\ App \ Entity \ Category') - > ** – Poiz
它的工作原理,谢谢 – Drakulitka
确定...请,请将下面的答案认可为正确答案,以便具有类似问题的未来访问者可以从中受益?谢谢...干杯.... – Poiz