mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-22 22:13:57 +00:00
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: mhmj
|
|
* Date: 22/05/2019
|
|
* Time: 3:17 PM
|
|
*/
|
|
|
|
namespace App\Classes\Modules\Warehouses\Services;
|
|
|
|
|
|
use App\Classes\Modules\Warehouses\DataTransferObjects\WarehouseObject;
|
|
use App\Models\Warehouse;
|
|
use App\Http\Resources\Warehouse as WarehouseResource;
|
|
|
|
class CreatesWarehouse
|
|
{
|
|
/** @var Warehouse */
|
|
private $repository;
|
|
|
|
/**
|
|
* CreatesWarehouse constructor.
|
|
* @param Warehouse $repository
|
|
*/
|
|
public function __construct(Warehouse $repository)
|
|
{
|
|
$this->repository = $repository;
|
|
}
|
|
|
|
|
|
public function execute(WarehouseObject $warehouse){
|
|
|
|
$this->repository->name = $warehouse->getName();
|
|
$this->repository->email = $warehouse->getEmail();
|
|
$this->repository->street_one = $warehouse->getStreetOne();
|
|
$this->repository->street_two = $warehouse->getStreetTwo();
|
|
$this->repository->city = $warehouse->getCity();
|
|
$this->repository->state = $warehouse->getState();
|
|
$this->repository->post_code = $warehouse->getPostCode();
|
|
$this->repository->country = $warehouse->getCountry();
|
|
$this->repository->save();
|
|
|
|
return $this->repository;
|
|
|
|
}
|
|
|
|
} |