@@ 67-73 (lines=7) @@ | ||
64 | */ |
|
65 | public function setChild($parent, $child) |
|
66 | { |
|
67 | if (is_string($parent)) { |
|
68 | $name = $parent; |
|
69 | $parent = $this->getItem($parent); |
|
70 | if (is_null($parent)) { |
|
71 | throw new InvalidParamException("Unknown parent:$name at setChild"); |
|
72 | } |
|
73 | } |
|
74 | if (is_string($child)) { |
|
75 | $name = $child; |
|
76 | $child = $this->getItem($child); |
|
@@ 74-80 (lines=7) @@ | ||
71 | throw new InvalidParamException("Unknown parent:$name at setChild"); |
|
72 | } |
|
73 | } |
|
74 | if (is_string($child)) { |
|
75 | $name = $child; |
|
76 | $child = $this->getItem($child); |
|
77 | if (is_null($child)) { |
|
78 | throw new InvalidParamException("Unknown child:$name at setChild"); |
|
79 | } |
|
80 | } |
|
81 | if (isset($this->children[$parent->name][$child->name])) { |
|
82 | return false; |
|
83 | } |