yii\rbac\DbManager::populateItem PHP Method

populateItem() protected method

Populates an auth item with the data fetched from database
protected populateItem ( array $row ) : Item
$row array the data from the auth item table
return Item the populated auth item instance (either Role or Permission)
    protected function populateItem($row)
    {
        $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();
        if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {
            $data = null;
        }
        return new $class(['name' => $row['name'], 'type' => $row['type'], 'description' => $row['description'], 'ruleName' => $row['rule_name'], 'data' => $data, 'createdAt' => $row['created_at'], 'updatedAt' => $row['updated_at']]);
    }