<?php

namespace App\Classes\Modules\HelpMenu\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\HelpMenu\DataTransferObjects\UrlObject;
use App\Models\Url;

class CreatesUrl extends AbstractUpdateRecord
{
    /**
     * @param UrlObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(UrlObject $object) {
        $model = new Url();
        $model->type = $object->getType();
        $model->short_url = $object->getShortUrl();
        $model->original_url = $object->getOriginalUrl();

        return $this->handler($model);

    }
}
