Advertisement
Guest User

Robert

a guest
Aug 18th, 2008
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. public function __call($var,$args)
  2. {
  3.     if($var == "uniq_id" || $var == "loaded" || in_array($var,$this->open_properties))
  4.     {
  5.         if(sizeof($args) > 0)
  6.         {
  7.             $arg = $args[0];
  8.             $this->$var = $arg;
  9.         }
  10.         else
  11.         {
  12.             if(isset($this->$var))
  13.             {
  14.                 return $this->$var;
  15.             }
  16.             else
  17.             {
  18.                 return null;
  19.             }
  20.         }
  21.     }
  22.     else
  23.     {
  24.         throw new Exception("Invalid var call [$var]!");
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement