mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
25 lines
914 B
PHP
25 lines
914 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Vouchers\Services;
|
|
|
|
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
|
|
use App\Classes\Modules\Vouchers\DataTransferObjects\VoucherEntityObject;
|
|
use App\Classes\General\Interfaces\Voucherifiable;
|
|
use App\Models\VoucherEntityMapping;
|
|
|
|
class CreatesVoucherEntityMapping extends AbstractUpdateRelationshipRecord
|
|
{
|
|
/**
|
|
* @param Voucherifiable $voucherifable
|
|
* @param VoucherObject $object
|
|
* @return \Illuminate\Database\Eloquent\Model
|
|
* @throws \App\Classes\Exceptions\MalformedRequestException
|
|
*/
|
|
public function execute(Voucherifiable $voucherifable, VoucherEntityObject $object) {
|
|
$model = new VoucherEntityMapping();
|
|
$model->voucherify_entity_id = $object->getId();
|
|
$model->voucherify_entity_type = $object->getType();
|
|
return $this->handler($voucherifable->voucherifyEntities(), $model);
|
|
}
|
|
}
|