<?php

namespace App\Classes\Modules\Segments\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Segments\DataTransferObjects\SegmentObject;
use App\Models\Segment;

class UpdatesSegment extends AbstractUpdateRecord
{

    /**
     * @param Segment $model
     * @param SegmentObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Segment $model, SegmentObject $object) 
    {
        $model->name = $object->getName();
        return $this->handler($model);
    }
}