City.php 813 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Core;
  4. // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * Classe ... qui ...
  8. */
  9. // #[Auditable]
  10. #[ORM\Entity]
  11. class City
  12. {
  13. #[ORM\Id]
  14. #[ORM\Column]
  15. #[ORM\GeneratedValue]
  16. private ?int $id = null;
  17. #[ORM\ManyToOne(targetEntity: Department::class, cascade: [])]
  18. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'SET NULL')]
  19. protected Department $department;
  20. public function getId(): ?int
  21. {
  22. return $this->id;
  23. }
  24. function getDepartment(): Department
  25. {
  26. return $this->department;
  27. }
  28. function setDepartment(Department $department): self
  29. {
  30. $this->department = $department;
  31. return $this;
  32. }
  33. }