public static function wrap($auths) { $authList = array(); foreach( $auths as $auth ) { $role = Role::getByID($auth['roleid']); array_push($authList, new Authentication($auth, $role)); } return $authList; }
public function __get($var) { if( $var == 'role' ) { return Role::getByID($this->roleid); } else { return $this->$var; } }
public function __get($var){ if( strtolower($var) == 'role' ){ return Role::getByID($this->roleid); } elseif( strtolower($var) == 'user' ){ return User::getByID($this->userid); } else{ return $this->$var; } }