false])] #[Groups(['composant:read', 'piece:read', 'product:read', 'machine:read'])] private bool $required = false; #[ORM\Column(type: Types::STRING, length: 255, nullable: true, name: 'defaultValue')] private ?string $defaultValue = null; #[ORM\Column(type: Types::JSON, nullable: true)] #[Groups(['composant:read', 'piece:read', 'product:read', 'machine:read'])] private ?array $options = null; #[ORM\Column(type: Types::INTEGER, options: ['default' => 0], name: 'orderIndex')] #[Groups(['composant:read', 'piece:read', 'product:read', 'machine:read'])] private int $orderIndex = 0; #[ORM\ManyToOne(targetEntity: Machine::class, inversedBy: 'customFields')] #[ORM\JoinColumn(name: 'machineId', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')] private ?Machine $machine = null; #[ORM\ManyToOne(targetEntity: ModelType::class, inversedBy: 'customFields')] #[ORM\JoinColumn(name: 'typeComposantId', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')] private ?ModelType $typeComposant = null; #[ORM\ManyToOne(targetEntity: ModelType::class, inversedBy: 'pieceCustomFields')] #[ORM\JoinColumn(name: 'typePieceId', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')] private ?ModelType $typePiece = null; #[ORM\ManyToOne(targetEntity: ModelType::class, inversedBy: 'productCustomFields')] #[ORM\JoinColumn(name: 'typeProductId', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')] private ?ModelType $typeProduct = null; /** * @var Collection */ #[ORM\OneToMany(mappedBy: 'customField', targetEntity: CustomFieldValue::class)] private Collection $customFieldValues; #[ORM\Column(type: Types::DATETIME_IMMUTABLE, name: 'createdAt')] private DateTimeImmutable $createdAt; #[ORM\Column(type: Types::DATETIME_IMMUTABLE, name: 'updatedAt')] private DateTimeImmutable $updatedAt; public function __construct() { $this->createdAt = new DateTimeImmutable(); $this->updatedAt = new DateTimeImmutable(); $this->customFieldValues = new ArrayCollection(); } public function getName(): string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getType(): string { return $this->type; } public function setType(string $type): static { $this->type = $type; return $this; } public function isRequired(): bool { return $this->required; } public function setRequired(bool $required): static { $this->required = $required; return $this; } public function getDefaultValue(): ?string { return $this->defaultValue; } public function setDefaultValue(?string $defaultValue): static { $this->defaultValue = $defaultValue; return $this; } public function getOptions(): ?array { return $this->options; } public function setOptions(?array $options): static { $this->options = $options; return $this; } public function getOrderIndex(): int { return $this->orderIndex; } public function setOrderIndex(int $orderIndex): static { $this->orderIndex = $orderIndex; return $this; } public function getMachine(): ?Machine { return $this->machine; } public function setMachine(?Machine $machine): static { $this->machine = $machine; return $this; } public function getTypeComposant(): ?ModelType { return $this->typeComposant; } public function setTypeComposant(?ModelType $typeComposant): static { $this->typeComposant = $typeComposant; return $this; } public function getTypePiece(): ?ModelType { return $this->typePiece; } public function setTypePiece(?ModelType $typePiece): static { $this->typePiece = $typePiece; return $this; } public function getTypeProduct(): ?ModelType { return $this->typeProduct; } public function setTypeProduct(?ModelType $typeProduct): static { $this->typeProduct = $typeProduct; return $this; } }