When I try to execute this DQL query:
SELECT r, s FROM Rule r
JOIN r.splash_page s
WHERE r.active = 1
What I’m trying to do is just join two Entities and I get this error:
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
These are part of my Entity files where I declare the relation between them:
// 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;
Any idea why is this happening?
You have a typo in your
$rulesdocblock: you have forgotten the@sign before OneToManyThe docblock should be:
instead of