ようこそ。 findByが意図したとおりに働いて、私が間違って何をやっているアクション(表現のZend +ドクトリン)その機能をリポジトリで使用する(Doctrine + Zend Expressive)
___________________
// 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()でリポジトリからその機能を呼び出すことは不可能でしょうか? (私が覚えている限り、zf2には同じ問題があった)
あなたはどのようなエラーを得ているの? *** $ this-> emはEntity Managerのインスタンスですか?***これは必須ではありませんが、アプリの前にバックスラッシュを追加してみてください:** $ this-> em-> getRepository( '\ App \ Entity \ Category') - > ??? ** – Poiz
それは働きました、ありがとうございます – Drakulitka
OK ...してください同様の問題を抱えている将来の訪問者が恩恵を受けるように、以下の回答を正しいものとして承認しますか?ありがとう...乾杯.... – Poiz