I have a user object that is set when a user logs in. There are also
permissions that I get about the user from a web service. Currently I
take the results from those web services and store them as XML in the
user object so I can parse it when I need to look at them. I wanted to
turn the xml permissions into ROle objects, but does that mean that my
User class needs to make reference to the Role class?
User class example
class User{
protected $firstName;
protected $lastName;
protected $employeeNumber ;
protected $orgCode;
protected $roles; //Could this be an object of my class Role?
protected $scope;
protected $type;
protected $primaryAssignm entsXML = null;
protected $securityRolesX ML = null;
.... getters ad setters
getRole(roleNam e){
//get the securityRolesXM L and then parse it setting the Role
Object
$role = new Role();
$role->setName();
$role->setFunction( );
return $role;
}
Is this how I should be going about this?
permissions that I get about the user from a web service. Currently I
take the results from those web services and store them as XML in the
user object so I can parse it when I need to look at them. I wanted to
turn the xml permissions into ROle objects, but does that mean that my
User class needs to make reference to the Role class?
User class example
class User{
protected $firstName;
protected $lastName;
protected $employeeNumber ;
protected $orgCode;
protected $roles; //Could this be an object of my class Role?
protected $scope;
protected $type;
protected $primaryAssignm entsXML = null;
protected $securityRolesX ML = null;
.... getters ad setters
getRole(roleNam e){
//get the securityRolesXM L and then parse it setting the Role
Object
$role = new Role();
$role->setName();
$role->setFunction( );
return $role;
}
Is this how I should be going about this?
Comment