*/ final class ChecklistMapper extends DataMapperFactory { /** * Columns. * * @var array * @since 1.0.0 */ public const COLUMNS = [ 'checklist_id' => ['name' => 'checklist_id', 'type' => 'int', 'internal' => 'id'], 'checklist_name' => ['name' => 'checklist_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], 'checklist_template' => ['name' => 'checklist_template', 'type' => 'int', 'internal' => 'template'], 'checklist_createdat' => ['name' => 'checklist_createdat', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ public const HAS_MANY = [ 'tasks' => [ 'mapper' => TaskMapper::class, 'table' => 'checklist_task', 'self' => 'checklist_task_checklist', 'external' => 'checklist_task_task', ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ public const TABLE = 'checklist'; /** * Primary field name. * * @var string * @since 1.0.0 */ public const PRIMARYFIELD = 'checklist_id'; }