<?php

namespace App\Classes\Modules\KeyValuePairs\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\KeyValuePairs\DataTransferObjects\KeyValuePairObject;
use App\Models\KeyValuePair;

class UpdatesKeyValuePair extends AbstractUpdateRecord
{
    /**
     * @param KeyValuePair $model
     * @param KeyValuePairObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(KeyValuePair $model, KeyValuePairObject $object) {
        $model->key = $object->getKey();
        $model->value = $object->getValue();
        return $this->handler($model);
    }
}
