This commit is contained in:
2021-08-05 11:40:29 +08:00
parent 40a7d8f123
commit d2c1d130c9
+2 -8
View File
@@ -261,14 +261,8 @@ class Node extends HttpService
*/
public function addChild(Node $node, string $field): Node
{
$field = (string)$field;
/** @var Node $oLod */
$oLod = $this->childes[$field] ?? null;
if (!empty($oLod)) {
$node = $oLod;
}
$this->childes[$field] = $node;
return $this->childes[$field];
$this->childes[] = $node;
return $node;
}