public function addChildren($items)
{
$manager = Configs::authManager();
$success = 0;
if ($this->_item) {
foreach ($items as $name) {
$child = $manager->getPermission($name);
if ($this->type == Item::TYPE_ROLE && $child === null) {
$child = $manager->getRole($name);
}
try {
$manager->addChild($this->_item, $child);
$success++;
} catch (\Exception $exc) {
Yii::error($exc->getMessage(), __METHOD__);
}
}
}
if ($success > 0) {
Helper::invalidate();
}
return $success;
}