<?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\PropertyFeature;/** * @ORM\Entity(repositoryClass="App\Repository\Properties\FeatureRepository") * @ORM\Table(name="properties_feature") * @ORM\HasLifecycleCallbacks() */class Feature 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\Column(type="string", length=128, nullable=false) * @Assert\NotBlank() */ private $name; /** * @ORM\OneToMany(targetEntity=PropertyFeature::class, mappedBy="feature", cascade={"all"}) **/ private $propertyFeatures; public function __construct(array $defaults = array()) { // Defaults $this->setUuid(Uuid::uuid4()); $this->setCreated(new \DateTime()); $this->propertyFeatures = new ArrayCollection(); parent::__construct($defaults); } public function __toString() { return $this->getName(); } 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 getName(): string { return $this->name; } public function setName(string $name): void { $this->name = $name; }}