25 lines
445 B
PHP
25 lines
445 B
PHP
<?php
|
|
|
|
namespace Modules\Tasks\Dto;
|
|
|
|
class TaskPersist
|
|
{
|
|
|
|
use TaskTrait;
|
|
|
|
public function loadOptions(array $data): void {}
|
|
|
|
public function getInsertAttrs(): array
|
|
{
|
|
$this->createdAt = time();
|
|
if (!$this->id) {
|
|
$this->id = uniqid('task_');
|
|
}
|
|
return [
|
|
'id' => $this->id,
|
|
'title' => $this->title,
|
|
'created_at' => $this->createdAt,
|
|
];
|
|
}
|
|
}
|