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.

35 lines
1.2KB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Models;
  4. class Board
  5. {
  6. public int $id = 0;
  7. public string $name = '';
  8. public string $slug = '';
  9. public bool $importFromPrintstream = false;
  10. public string $printstreamJobName = '';
  11. public ?string $createdAt = null;
  12. public string $createdBy = '';
  13. public ?string $updatedAt = null;
  14. public string $updatedBy = '';
  15. public static function fromRow(array $row): self
  16. {
  17. $model = new self();
  18. $model->id = (int) ($row['id'] ?? 0);
  19. $model->name = (string) ($row['name'] ?? '');
  20. $model->slug = (string) ($row['slug'] ?? '');
  21. $model->importFromPrintstream = (bool) ($row['import_from_printstream'] ?? false);
  22. $model->printstreamJobName = (string) ($row['printstream_job_name'] ?? '');
  23. $model->createdAt = $row['created_at'] ?? null;
  24. $model->createdBy = (string) ($row['created_by'] ?? '');
  25. $model->updatedAt = $row['updated_at'] ?? null;
  26. $model->updatedBy = (string) ($row['updated_by'] ?? '');
  27. return $model;
  28. }
  29. }

Powered by TurnKey Linux.