当我尝试执行此 DQL 查询时:
SELECT r, s FROM Rule r
JOIN r.splash_page s
WHERE r.active = 1
我想要做的只是加入两个实体,我得到这个错误:
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;
知道为什么会这样吗?