protected function onChildNodesVisited($parent, $nodes)
{
if (empty($parent) || empty($this->_entries[$parent])) {
return;
}
$parentObject = $this->_entries[$parent]['object'];
$property = $this->_entries[$nodes[0]]['property'];
$list = TPropertyAccess::get($parentObject, $property);
foreach ($nodes as $node) {
if ($list instanceof TList) {
$parentObject->{$property}[] = $this->_entries[$node]['object'];
} else {
if (is_array($list)) {
$list[] = $this->_entries[$node]['object'];
} else {
throw new TSqlMapExecutionException('sqlmap_property_must_be_list');
}
}
}
if (is_array($list)) {
TPropertyAccess::set($parentObject, $property, $list);
}
if ($this->_entries[$parent]['property'] === null) {
$this->_list[] = $parentObject;
}
}