Resolution: Won't Fix
Affects Version/s: 2.0-BETA4
Fix Version/s: 2.0-RC1
Security Level: All
Environment:Ubuntu Linux, MySQL
I have an entity which has a many to one relationship pointing to itself. This is ultimately set to map parent/child relationships.
Consider the following snippet:
// Start out assuming we are searching for "Pages" with no parent specified (root level).
$parentId = null;
// Check to see if we're fetching pages that are a child of a parent.
$pages = $this->entityManager->getRepository("MyNamespace\Models\Page")->findByParent($parentId);
When this code is run, PHP tells me:
PHP Fatal error: Uncaught exception 'Doctrine\\ORM
ORMException' with message 'You need to pass a parameter to 'findByParent''
At which point, it's obvious that it's expecting a parameter an receiving none. The problem here however is that I have no way of matching for null. Is there some kind of surrogate null php-class that can be created to represent a model-null?