<?phpnamespace App\Entity\Properties;use Doctrine\Common\Collections\ArrayCollection;use Symfony\Component\Validator\Constraints AS Assert;use Doctrine\ORM\Mapping AS ORM;use Ramsey\Uuid\Uuid;use Ramsey\Uuid\Lazy\LazyUuidFromString;use App\Entity\BaseEntity;use App\Entity\Properties\Property;use App\Entity\Properties\Feature;/** * @ORM\Entity(repositoryClass="App\Repository\Properties\PropertyFeatureRepository") * @ORM\Table(name="properties_propertyfeature") * @ORM\HasLifecycleCallbacks() */class PropertyFeature extends BaseEntity{ /** * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="uuid") * @Assert\Uuid */ protected $uuid; /** * @var \DateTime * * @ORM\Column(type="datetime", nullable=false) * @Assert\Type("\DateTime") */ private $created; /** * @ORM\ManyToOne(targetEntity=Property::class, inversedBy="propertyFeatures") * @ORM\JoinColumn(nullable=false) * @Assert\NotNull **/ private $property; /** * @ORM\ManyToOne(targetEntity=Feature::class, inversedBy="propertyFeatures") * @ORM\JoinColumn(nullable=false) * @Assert\NotNull **/ private $feature; public function __construct(array $defaults = array()) { // Defaults $this->setUuid(Uuid::uuid4()); $this->setCreated(new \DateTime()); parent::__construct($defaults); } public function __toString() { return $this->getId(); } public function getId(): ?int { return $this->id; } public function getUuid(): LazyUuidFromString { return $this->uuid; } public function setUuid(LazyUuidFromString $uuid): void { $this->uuid = $uuid; } public function setCreated(\DateTime $created): void { $this->created = $created; } public function getCreated(): \DateTime { return $this->created; } public function getProperty() { return $this->property; } public function setProperty(Property $property) { $this->property = $property; } public function getFeature() { return $this->feature; } public function setFeature(Feature $feature) { $this->feature = $feature; }}