Пример #1
0
		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;
		}
Пример #2
0
		public function __get($var)
		{
			if( $var == 'role' )
			{
				return Role::getByID($this->roleid);
			}
			else
			{
				return $this->$var;
			}
		}
Пример #3
0
		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;
			}
		}