mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
28 lines
834 B
PHP
28 lines
834 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Currencies\Services;
|
|
|
|
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
|
|
use App\Classes\Modules\Currencies\DataTransferObjects\CurrencyObject;
|
|
use App\Models\Country;
|
|
use App\Models\Currency;
|
|
|
|
class CreatesCurrency extends AbstractUpdateRelationshipRecord
|
|
{
|
|
/**
|
|
* @param Country $country
|
|
* @param CurrencyObject $object
|
|
* @return \Illuminate\Database\Eloquent\Model
|
|
* @throws \App\Classes\Exceptions\MalformedRequestException
|
|
*/
|
|
public function execute(Country $country, CurrencyObject $object) {
|
|
|
|
$model = new Currency();
|
|
$model->name = $object->getName();
|
|
$model->short_code = $object->getShortCode();
|
|
$model->symbol = $object->getSymbol();
|
|
|
|
return $this->handler($country->currencies(), $model);
|
|
|
|
}
|
|
} |