Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

35 lines
1.0KB

  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 ?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->boardId = (int) ($row['board_id'] ?? 0);
  20. $model->name = (string) ($row['name'] ?? '');
  21. $model->position = (int) ($row['position'] ?? 0);
  22. $model->showCardCount = (bool) ($row['show_card_count'] ?? false);
  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.