diff options
Diffstat (limited to 'classes/Offer.php')
-rw-r--r-- | classes/Offer.php | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/classes/Offer.php b/classes/Offer.php index 2a48604..202c0e8 100644 --- a/classes/Offer.php +++ b/classes/Offer.php @@ -28,44 +28,9 @@ class Offer extends Model{ /** {@inheritDoc} */ public $table = 'offer', - $fillable_columns = ['contactId', 'start_date', 'end_date', 'invoice_date', 'accepted', 'invoice_fileId', 'payment_key']; - - /** - * {@inheritDoc} - * @param $key {@inheritDoc} - * @param $value {@inheritDoc} - */ - protected function accessor($key, $value) { - switch ($key) { - case 'start_date': - case 'end_date': - case 'invoice_date': - return strtotime($value); - break; - case 'accepted': - return (bool) $value; - case 'invoice_fileId': - return $value == null ? null : (int) $value; - default: - return parent::accessor($key, $value); - } - } - - /** - * {@inheritDoc} - * @param $key {@inheritDoc} - * @param $value {@inheritDoc} - */ - protected function mutator($key, $value) { - switch ($key) { - case 'start_date': - case 'end_date': - case 'invoice_date': - return is_string($value) ? $value : date('Y-m-d', $value); - default: - return parent::mutator($key, $value); - } - } + $fillable_columns = ['contactId', 'start_date', 'end_date', 'invoice_date', 'accepted', 'invoice_fileId', 'payment_key'], + $dates = ['start_date', 'end_date', 'invoice_date'], + $booleans = ['accepted']; /** * A random max-63-char string that can be used as payment_key |