You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- declare(strict_types=1);
-
- namespace App\Models;
-
- class Board
- {
- public int $id = 0;
- public string $name = '';
- public string $slug = '';
- public bool $importFromPrintstream = false;
- public string $printstreamJobName = '';
- public ?string $createdAt = null;
- public string $createdBy = '';
- public ?string $updatedAt = null;
- public string $updatedBy = '';
-
- public static function fromRow(array $row): self
- {
- $model = new self();
- $model->id = (int) ($row['id'] ?? 0);
- $model->name = (string) ($row['name'] ?? '');
- $model->slug = (string) ($row['slug'] ?? '');
- $model->importFromPrintstream = (bool) ($row['import_from_printstream'] ?? false);
- $model->printstreamJobName = (string) ($row['printstream_job_name'] ?? '');
- $model->createdAt = $row['created_at'] ?? null;
- $model->createdBy = (string) ($row['created_by'] ?? '');
- $model->updatedAt = $row['updated_at'] ?? null;
- $model->updatedBy = (string) ($row['updated_by'] ?? '');
-
- return $model;
- }
- }
|