このDQLクエリを実行しようとすると:
SELECT r, s FROM Rule r
JOIN r.splash_page s
WHERE r.active = 1
私がやろうとしているのは、2つのエンティティに参加するだけで、次のエラーが発生します。
Notice: Undefined index: rules in C:\xampp\htdocs\excap\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 110
Notice: Undefined index: rules in C:\xampp\htdocs\excap\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 428
Notice: Undefined index: rules in C:\xampp\htdocs\excap\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 428
Notice: Undefined index: rules in C:\xampp\htdocs\excap\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 428
Notice: Undefined index: rules in C:\xampp\htdocs\excap\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 428
これらは、エンティティファイルの一部であり、それらの間の関係を宣言します。
// Rule.php
/**
*
* @var type
* @ManyToOne(targetEntity="SplashPage", inversedBy="rules")
*/
protected $splash_page;
// SplashPage.php
/**
*
* @var type
* OneToMany(targetEntity="Rule", mappedBy="splash_page")
*/
protected $rules = null;
なぜこれが起こっているのか考えてみてください。