Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

39 linhas
1.3KB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Models;
  4. class BoardColumn
  5. {
  6. public int $id = 0;
  7. public int $boardId = 0;
  8. public string $name = '';
  9. public int $position = 0;
  10. public bool $showCardCount = 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->showCardCount = (bool) ($row['show_card_count'] ?? 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.