public function __set($key, $value)
 {
     if ($value === '') {
         throw new Exception("Missing value for {$key}");
     }
     return parent::__set($key, $value);
 }
 public function __set($key, $value)
 {
     switch ($key) {
         case 'account_id':
             if (!is_numeric($value) || $value <= 0) {
                 throw new Exception("Du måste ange ett giltigt konto.");
             }
             break;
     }
     parent::__set($key, $value);
 }
 public function __set($key, $value)
 {
     switch ($key) {
         case 'price':
             if ($this->_exists && isset($this->_old_price)) {
                 $this->_old_price = $this->price;
             }
     }
     if ($value === '') {
         $value = null;
     }
     return parent::__set($key, $value);
 }