src/Entity/WorkHours.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WorkHoursRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=WorkHoursRepository::class)
  7. */
  8. class WorkHours
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\ManyToOne(targetEntity=Workers::class, inversedBy="minutes")
  18. * @ORM\JoinColumn(nullable=false)
  19. */
  20. private $worker;
  21. /**
  22. * @ORM\Column(type="date", nullable=true)
  23. */
  24. private $payed;
  25. /**
  26. * @ORM\Column(type="datetime", nullable=true)
  27. */
  28. private $created;
  29. /**
  30. * @ORM\ManyToOne(targetEntity=Projects::class, inversedBy="workHours")
  31. */
  32. private $project;
  33. /**
  34. * @ORM\Column(type="integer", nullable=true)
  35. */
  36. private $payed_hour_price;
  37. /**
  38. * @ORM\Column(type="float", nullable=true)
  39. */
  40. private $hours;
  41. /**
  42. * @ORM\Column(type="date", nullable=true)
  43. */
  44. private $day;
  45. /**
  46. * @ORM\Column(type="text", nullable=true)
  47. */
  48. private $note;
  49. /**
  50. * @ORM\ManyToOne(targetEntity=ProjectProducts::class, inversedBy="workHours")
  51. */
  52. private $projectProduct;
  53. /**
  54. * @ORM\Column(type="integer", nullable=true)
  55. */
  56. private $other_price;
  57. /**
  58. * @ORM\ManyToOne(targetEntity=User::class, cascade={"persist"})
  59. */
  60. private $validated;
  61. /**
  62. * @ORM\Column(type="datetime", nullable=true)
  63. */
  64. private $validatedDate;
  65. /**
  66. * @ORM\Column(type="boolean")
  67. */
  68. private $isValidated;
  69. public function __construct()
  70. {
  71. $this->created = new \DateTime();
  72. }
  73. public function getId(): ?int
  74. {
  75. return $this->id;
  76. }
  77. public function getWorker(): ?Workers
  78. {
  79. return $this->worker;
  80. }
  81. public function setWorker(?Workers $worker): self
  82. {
  83. $this->worker = $worker;
  84. return $this;
  85. }
  86. public function getPayed(): ?\DateTimeInterface
  87. {
  88. return $this->payed;
  89. }
  90. public function setPayed(?\DateTimeInterface $payed): self
  91. {
  92. if($this->isValidated){
  93. $this->payed = $payed;
  94. }
  95. return $this;
  96. }
  97. public function getCreated(): ?\DateTimeInterface
  98. {
  99. return $this->created;
  100. }
  101. public function setCreated(?\DateTimeInterface $created): self
  102. {
  103. $this->created = $created;
  104. return $this;
  105. }
  106. public function getProject(): ?Projects
  107. {
  108. return $this->project;
  109. }
  110. public function setProject(?Projects $project): self
  111. {
  112. $this->project = $project;
  113. return $this;
  114. }
  115. public function getPayedHourPrice(): ?int
  116. {
  117. return $this->payed_hour_price;
  118. }
  119. public function setPayedHourPrice(?int $payed_hour_price): self
  120. {
  121. $this->payed_hour_price = $payed_hour_price;
  122. return $this;
  123. }
  124. public function getHours(): ?float
  125. {
  126. return $this->hours;
  127. }
  128. public function setHours(?float $hours): self
  129. {
  130. $this->hours = $hours;
  131. return $this;
  132. }
  133. public function getDay(): ?\DateTimeInterface
  134. {
  135. return $this->day;
  136. }
  137. public function setDay(?\DateTimeInterface $day): self
  138. {
  139. $this->day = $day;
  140. return $this;
  141. }
  142. public function getNote(): ?string
  143. {
  144. return $this->note;
  145. }
  146. public function setNote(?string $note): self
  147. {
  148. $this->note = $note;
  149. return $this;
  150. }
  151. public function getProjectProduct(): ?ProjectProducts
  152. {
  153. return $this->projectProduct;
  154. }
  155. public function setProjectProduct(?ProjectProducts $projectProduct): self
  156. {
  157. if($projectProduct){
  158. $this->setProject($projectProduct->getProject());
  159. }
  160. $this->projectProduct = $projectProduct;
  161. return $this;
  162. }
  163. public function getOtherPrice(): ?int
  164. {
  165. return $this->other_price;
  166. }
  167. public function setOtherPrice(?int $other_price): self
  168. {
  169. $this->other_price = $other_price;
  170. return $this;
  171. }
  172. public function getValidated(): ?User
  173. {
  174. return $this->validated;
  175. }
  176. public function setValidated(?User $validated): self
  177. {
  178. $this->validated = $validated;
  179. return $this;
  180. }
  181. public function getValidatedDate(): ?\DateTimeInterface
  182. {
  183. return $this->validatedDate;
  184. }
  185. public function setValidatedDate(?\DateTimeInterface $validatedDate): self
  186. {
  187. $this->validatedDate = $validatedDate;
  188. return $this;
  189. }
  190. public function getIsValidated(): ?bool
  191. {
  192. return $this->isValidated;
  193. }
  194. public function setIsValidated(bool $isValidated): self
  195. {
  196. $this->isValidated = $isValidated;
  197. return $this;
  198. }
  199. }