Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Labels:None
Description
If you create children of a document without adding them to the children collection of the parent (with a children annotation) the children collection is not updated after flush, you need to call $dm->clear() to force a reread of the children. The current case was with a parent and its children created in the same flush.
Activity
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=PHPCR-80, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Try this code:
$node1 = new Generic();
$node1->setParent($parent);
$node1->setNodename('source');
$this->dm->persist($node1);
$this->childrenNames = array('first', 'second', 'third', 'fourth');
{ $child = new Generic(); $child->setNodename($childName); $child->setParent($node1); $this->dm->persist($child); }foreach ($this->childrenNames as $childName)
$this->dm->flush();
$this->dm->clear();
$node = $this->dm->find(null, '/functional/source');
$children = $node->getChildren();
// without the clear above $children === NULL, with the clear it works as expected