exampleapp/modules/Tasks/Infrastructure/DBPersistLayer/TasksLayer.php

25 lines
450 B
PHP

<?php
namespace Modules\Tasks\Infrastructure\DBPersistLayer;
use Illuminate\Support\Facades\DB;
use Modules\Tasks\Dto\TaskPersist;
class TasksLayer
{
private string $table;
public function setTable(string $table): void
{
$this->table = $table;
}
public function insert(TaskPersist $dto): void
{
$qb = DB::table($this->table);
$attrs = $dto->getInsertAttrs();
$qb->insert($attrs);
}
}