src/App/Entity/GeneralValuesGauge.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity
  7. *
  8. * @ORM\Table(
  9. * name="general_values_gauges",
  10. * uniqueConstraints={
  11. *
  12. * @ORM\UniqueConstraint(name="gauge_type_measured_at_idx", columns={"gauge_type", "measured_at"})
  13. * }
  14. * )
  15. */
  16. class GeneralValuesGauge
  17. {
  18. public const GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_TOTAL = 0;
  19. public const GAUGE_TYPE_NUMBER_OF_JOBSEEKERS_TOTAL = 1;
  20. public const GAUGE_TYPE_NUMBER_OF_JOBOFFERERS_TOTAL = 2;
  21. public const GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_FROM_A_FEED_IN_EBAY_FEED = 18;
  22. public const GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_FROM_B_FEED_IN_EBAY_FEED = 19;
  23. public const GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_FROM_C_FEED_IN_EBAY_FEED = 20;
  24. // ! GENERAL VALUE GAUGE TYPES ARE ALSO DEFINED IN contentDistributorFeed->generalValueGaugeType. Please avoid double usage by checking there first.
  25. // A FULL DOC CAN BE FOUND HERE: https://go-gastro.atlassian.net/wiki/spaces/JOB/pages/2341404677/General+Values+Gauges PLEASE ADD THE ONES YOU CREATED HERE
  26. public const POSSIBLE_GENERAL_VALUES_GAUGE_TYPES = [
  27. self::GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_TOTAL,
  28. self::GAUGE_TYPE_NUMBER_OF_JOBSEEKERS_TOTAL,
  29. self::GAUGE_TYPE_NUMBER_OF_JOBOFFERERS_TOTAL,
  30. self::GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_FROM_A_FEED_IN_EBAY_FEED,
  31. self::GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_FROM_B_FEED_IN_EBAY_FEED,
  32. self::GAUGE_TYPE_NUMBER_OF_RECURRENT_JOBS_FROM_C_FEED_IN_EBAY_FEED
  33. ];
  34. public function __construct(
  35. int $gaugeType,
  36. DateTime $measuredAt,
  37. int $value
  38. ) {
  39. $this->gaugeType = $gaugeType;
  40. $this->measuredAt = $measuredAt;
  41. $this->value = $value;
  42. }
  43. /**
  44. * @ORM\GeneratedValue(strategy="CUSTOM")
  45. *
  46. * @ORM\CustomIdGenerator(class="App\Utility\DatabaseIdGenerator")
  47. *
  48. * @ORM\Column(name="id", type="guid")
  49. *
  50. * @ORM\Id
  51. */
  52. protected string $id;
  53. /**
  54. * @ORM\Column(name="gauge_type", type="smallint", nullable=false)
  55. */
  56. private int $gaugeType;
  57. /**
  58. * @ORM\Column(name="measured_at", type="datetime", nullable=false)
  59. */
  60. private DateTime $measuredAt;
  61. /**
  62. * @ORM\Column(name="value", type="integer", nullable=false)
  63. */
  64. private int $value;
  65. public function getId(): string
  66. {
  67. return $this->id;
  68. }
  69. public function getGaugeType(): int
  70. {
  71. return $this->gaugeType;
  72. }
  73. public function getMeasuredAt(): DateTime
  74. {
  75. return $this->measuredAt;
  76. }
  77. public function getValue(): int
  78. {
  79. return $this->value;
  80. }
  81. }