|
@@ 247-259 (lines=13) @@
|
| 244 |
|
* @param Item|string $parent Either name or Item instance which is parent |
| 245 |
|
* @param Item|string $child Either name or Item instance which is child |
| 246 |
|
*/ |
| 247 |
|
protected function addChild($parent, $child) |
| 248 |
|
{ |
| 249 |
|
if (is_string($parent)) { |
| 250 |
|
$parent = $this->findItem($parent); |
| 251 |
|
} |
| 252 |
|
if (is_string($child)) { |
| 253 |
|
$child = $this->findItem($child); |
| 254 |
|
} |
| 255 |
|
echo " > adding $child->name as child to $parent->name ..."; |
| 256 |
|
$time = microtime(true); |
| 257 |
|
$this->authManager->addChild($parent, $child); |
| 258 |
|
echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n"; |
| 259 |
|
} |
| 260 |
|
|
| 261 |
|
/** |
| 262 |
|
* Removes child. |
|
@@ 267-279 (lines=13) @@
|
| 264 |
|
* @param Item|string $parent Either name or Item instance which is parent |
| 265 |
|
* @param Item|string $child Either name or Item instance which is child |
| 266 |
|
*/ |
| 267 |
|
protected function removeChild($parent, $child) |
| 268 |
|
{ |
| 269 |
|
if (is_string($parent)) { |
| 270 |
|
$parent = $this->findItem($parent); |
| 271 |
|
} |
| 272 |
|
if (is_string($child)) { |
| 273 |
|
$child = $this->findItem($child); |
| 274 |
|
} |
| 275 |
|
echo " > removing $child->name from $parent->name ..."; |
| 276 |
|
$time = microtime(true); |
| 277 |
|
$this->authManager->removeChild($parent, $child); |
| 278 |
|
echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n"; |
| 279 |
|
} |
| 280 |
|
|
| 281 |
|
/** |
| 282 |
|
* Assigns a role to a user. |