我正在尝试为yii 2 rbac创建一个控制台命令 例外:
'yii \ base \ UnknownMethodException',消息'调用未知 方法:yii \ rbac \ DbManager :: getItem()'
protected function createItem($name,$type,$description='',$data=null)
{
$item=$this->_authManager->getItem($name);
if($item===null)
{
$item = new Item;
$item->name = $name;
$item->type = $type;
$item->description = $description;
self::$newCount++;
echo "creating new item $name \n";
$item=$this->_authManager->addItem($item);
}
return $item;
}