public function __set($variableName, $value) { switch ($variableName) { case 'addDate': case 'setDate': $variableName = '_' . $variableName; if (is_null($value)) { $this->{$variableName} = null; return; } if ($value instanceof Zend_Date) { $this->{$variableName} = $value; return; } if (Zend_Date::isDate($value, 'YYYY.MM.dd HH:mm:ss')) { $this->{$variableName} = new Zend_Date($value, 'YYYY.MM.dd HH:mm:ss'); return; } throw new Vo_Exception("La chaine de caractères n'est pas une date ou n'est pas au format ISO 8601 ('{$value}')", 4); break; case 'user': $variableName = '_' . $variableName; if (is_null($value)) { $this->{$variableName} = null; return; } $this->{$variableName} = $value; return; break; case "isValid": $this->validate($value); return; break; case 'users_id': $this->_user = $value; break; } parent::__set($variableName, $value); }