選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

39 行
1.3KB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Models;
  4. class SwimLane
  5. {
  6. public int $id = 0;
  7. public int $boardId = 0;
  8. public string $name = '';
  9. public int $position = 0;
  10. public bool $showExportButton = false;
  11. public bool $showCardAge = false;
  12. public int $cardAgeWarningDays = 0;
  13. public ?string $createdAt = null;
  14. public string $createdBy = '';
  15. public ?string $updatedAt = null;
  16. public string $updatedBy = '';
  17. public static function fromRow(array $row): self
  18. {
  19. $model = new self();
  20. $model->id = (int) ($row['id'] ?? 0);
  21. $model->boardId = (int) ($row['board_id'] ?? 0);
  22. $model->name = (string) ($row['name'] ?? '');
  23. $model->position = (int) ($row['position'] ?? 0);
  24. $model->showExportButton = (bool) ($row['show_export_button'] ?? false);
  25. $model->showCardAge = (bool) ($row['show_card_age'] ?? false);
  26. $model->cardAgeWarningDays = (int) ($row['card_age_warning_days'] ?? 0);
  27. $model->createdAt = $row['created_at'] ?? null;
  28. $model->createdBy = (string) ($row['created_by'] ?? '');
  29. $model->updatedAt = $row['updated_at'] ?? null;
  30. $model->updatedBy = (string) ($row['updated_by'] ?? '');
  31. return $model;
  32. }
  33. }

Powered by TurnKey Linux.