ProjectDetector.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Services\History\Detector;
  3. use App\Services\History\Converter\CustomFieldSelectConverter;
  4. use App\Services\History\Converter\ModelEnumConverter;
  5. use App\Services\History\Converter\WhitelistConverter;
  6. class ProjectDetector extends DetectorAbstract
  7. {
  8. public static function fields(): array
  9. {
  10. return [
  11. 'name',
  12. 'code',
  13. 'const',
  14. 'status',
  15. 'begin',
  16. 'end',
  17. 'latitude',
  18. 'type',
  19. 'acl',
  20. 'whitelist',
  21. 'description',
  22. ];
  23. }
  24. public static function diffFields(): array
  25. {
  26. return [
  27. 'description',
  28. ];
  29. }
  30. public static function converters(): array
  31. {
  32. return [
  33. "whitelist" => new WhitelistConverter(),
  34. "acl" => new ModelEnumConverter("project.acl"),
  35. "status" => new ModelEnumConverter("project.status"),
  36. "type" => new CustomFieldSelectConverter("project", "type"),
  37. ];
  38. }
  39. }