добавляю все изменения проекта на текущий момент
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Services;
|
||||
|
||||
use Modules\Taxi\App\Models as TaxiModels;
|
||||
use Modules\Taxi\App\DTO\TaxiOrderDTO;
|
||||
|
||||
/**
|
||||
* Сервис работы с заказами такси
|
||||
*/
|
||||
class TaxiOrderService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод создания заказа на такси
|
||||
*
|
||||
* @param TaxiOrderDTO $orderData объект с данными по заказу
|
||||
* @return int идентификатор созданного заказа
|
||||
*/
|
||||
public function createOrder(TaxiOrderDTO $orderData): string
|
||||
{
|
||||
//ГАВРИЛОВ. проверь будет ли возвращаться ошибка без try catch
|
||||
// try {
|
||||
$newOrder = TaxiModels\TaxiMain::create(
|
||||
[
|
||||
'emp_login' => $orderData->emp_login,
|
||||
'taxi_date' => $orderData->taxi_date,
|
||||
'emp_phone' => $orderData->emp_phone,
|
||||
'taxi_time' => $orderData->taxi_time,
|
||||
'taxi_address_from' => $orderData->taxi_address_from,
|
||||
'taxi_address_to' => $orderData->taxi_address_to
|
||||
]
|
||||
);
|
||||
return $newOrder->id;
|
||||
// } catch (\Exception $e) {
|
||||
// return $e->getMessage();
|
||||
// }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user