Role name and packageKey are not accessible
Properties name and packageKey for Role are not accessible, because setNameAndPackageKey() is not called.
Calling setNameAndPackageKey() in __construct() solves this.
Updated by Rafael Kähm over 8 years ago
yes it is but _construct() is not called by roles from repository.
_construct() is called only by "Anonymous" and "Everybody".
Q: How did you instanciate the Role object?
A: Roles are loaded from Repository over Account. ($account->getRoles())