Guest User

Untitled

a guest
Oct 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1.   /**
  2.      * Magic Method for setting model attributes.
  3.      */
  4.     public function __set($key, $value)
  5.     {
  6.         // If the key is a relationship, add it to the ignored attributes.
  7.         // Ignored attributes are not stored in the database.
  8.         if (method_exists($this, $key))
  9.         {
  10.             $this->ignore[$key] = $value;
  11.         }
  12.         else
  13.         {
  14.           if($this->attributes[$key] !== $value) $this->dirty[$key] = $value;
  15.             $this->attributes[$key] = $value;
  16.         }
  17.     }
Add Comment
Please, Sign In to add comment