<?php

namespace App\Classes\Modules\Accounts\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Accounts\DataTransferObjects\UserObject;
use App\Models\User;

class UpdatesUser extends AbstractUpdateRecord
{

    /**
     * @param User $model
     * @param UserObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(User $model, UserObject $object) {

        $model->name = $object->getName();
        $model->type = $object->getType();
        return $this->handler($model);

    }
}