dektrium\rbac\migrations\Migration::addChild PHP Method

addChild() protected method

Adds child.
protected addChild ( Item | string $parent, Item | string $child )
$parent yii\rbac\Item | string Either name or Item instance which is parent
$child yii\rbac\Item | string Either name or Item instance which is child
    protected function addChild($parent, $child)
    {
        if (is_string($parent)) {
            $parent = $this->findItem($parent);
        }
        if (is_string($child)) {
            $child = $this->findItem($child);
        }
        echo "    > adding {$child->name} as child to {$parent->name} ...";
        $time = microtime(true);
        $this->authManager->addChild($parent, $child);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }