protected function getNewRoleId($oldRoleId)
    {
        if (empty($oldRoleId)) {
            return null;
        }

        $roles = $this->package->getResourceFromZip('system/role.json');
        $roleName = null;
        foreach ($roles as $role) {
            if ($oldRoleId === $role['id']) {
                $roleName = $role['name'];
                break;
            }
        }

        if (!empty($roleName)) {
            $newRole = Role::whereName($roleName)->first(['id']);
            if (!empty($newRole)) {
                return $newRole->id;
            }
        }

        return null;
    }
protected function getNewRoleId($oldRoleId)
    {
        if (empty($oldRoleId)) {
            return null;
        }

        $roles = $this->package->getResourceFromZip('system/role.json');
        $roleName = null;
        foreach ($roles as $role) {
            if ($oldRoleId === $role['id']) {
                $roleName = $role['name'];
                break;
            }
        }

        if (!empty($roleName)) {
            $newRole = Role::whereName($roleName)->first(['id']);
            if (!empty($newRole)) {
                return $newRole->id;
            }
        }

        return null;
    }
protected function getNewRoleId ( $ oldRoleId ) { if ( empty ( $ oldRoleId ) ) { return null ; } $ roles = $ this -> package -> getResourceFromZip ( 'system/role.json' ) ; $ roleName = null ; foreach ( $ roles as $ role ) { if ( $ oldRoleId === $ role [ 'id' ] ) { $ roleName = $ role [ 'name' ] ; break ; } } if ( ! empty ( $ roleName ) ) { $ newRole = Role :: whereName ( $ roleName ) -> first ( [ 'id' ] ) ; if ( ! empty ( $ newRole ) ) { return $ newRole -> id ; } } return null ; }
Finds and returns the new role id by old id.

@param int $oldRoleId

@return int|null
Finds and returns the new role id by old id .