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