Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mcoil.corals.io/app/Shop/Quotations/Transformations/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/app/Shop/Quotations/Transformations/QuotationTransformable.php
<?php

namespace App\Shop\Quotations\Transformations;

use App\Shop\Businesses\Business;
use App\Shop\Customers\Customer;
use App\Shop\Quotations\Quotation;
use App\Shop\QuotationStatuses\QuotationStatus;
use App\Shop\Businesses\Repositories\BusinessRepository;
use App\Shop\Customers\Repositories\CustomerRepository;
use App\Shop\QuotationStatuses\Repositories\QuotationStatusRepository;



trait QuotationTransformable
{
    /**
     * Transform the quotation
     *
     * @param Quotation $quotation
     *
     * @return Quotation
     * @throws \App\Shop\Cities\Exceptions\CityNotFoundException
     */
    public function transformQuotation(Quotation $quotation)
    {
        $obj = new Quotation;
        $obj->id = $quotation->id;

        $obj->title = $quotation->title;
        $obj->availabledate = $quotation->availabledate;
        $obj->status = $quotation->status;
        $obj->quotation_status_id = $quotation->quotation_status_id;

        $quotationStatusRepo = new QuotationStatusRepository(new QuotationStatus);
        $status = $quotationStatusRepo->findQuotationStatusById($quotation->quotation_status_id);
        $obj->status_type = $status->name;

        $customerRepo = new CustomerRepository(new Customer);
        $customer = $customerRepo->findCustomerById($quotation->customer_id);
        $obj->customer = $customer->full_name;

        $businessRepo = new BusinessRepository(new Business);

        $business = $businessRepo->findBusinessById($quotation->business_id);
        $obj->business = $business->title;

        return $obj;
    }
}

Spamworldpro Mini