| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Core;
- // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Classe ... qui ...
- */
- // #[Auditable]
- #[ORM\Entity]
- class City
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\ManyToOne(targetEntity: Department::class, cascade: [])]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'SET NULL')]
- protected Department $department;
- public function getId(): ?int
- {
- return $this->id;
- }
- function getDepartment(): Department
- {
- return $this->department;
- }
- function setDepartment(Department $department): self
- {
- $this->department = $department;
- return $this;
- }
- }
|