|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace PhpList\Core\Domain\Model\Identity; |
| 6 | + |
| 7 | +use Doctrine\ORM\Mapping as ORM; |
| 8 | +use PhpList\Core\Domain\Model\Interfaces\DomainModel; |
| 9 | +use PhpList\Core\Domain\Model\Interfaces\Identity; |
| 10 | +use PhpList\Core\Domain\Model\Traits\IdentityTrait; |
| 11 | + |
| 12 | +#[ORM\Entity] |
| 13 | +#[ORM\Table(name: "phplist_user_attribute")] |
| 14 | +#[ORM\Index(name: "idnameindex", columns: ["id", "name"])] |
| 15 | +#[ORM\Index(name: "nameindex", columns: ["name"])] |
| 16 | +class UserAttribute implements DomainModel, Identity |
| 17 | +{ |
| 18 | + use IdentityTrait; |
| 19 | + |
| 20 | + #[ORM\Column(name: "name", type: "string", length: 255)] |
| 21 | + private string $name; |
| 22 | + |
| 23 | + #[ORM\Column(name: "type", type: "string", length: 30, nullable: true)] |
| 24 | + private ?string $type = null; |
| 25 | + |
| 26 | + #[ORM\Column(name: "listorder", type: "integer", nullable: true)] |
| 27 | + private ?int $listOrder = null; |
| 28 | + |
| 29 | + #[ORM\Column(name: "default_value", type: "string", length: 255, nullable: true)] |
| 30 | + private ?string $defaultValue = null; |
| 31 | + |
| 32 | + #[ORM\Column(name: "required", type: "boolean", nullable: true)] |
| 33 | + private ?bool $required = null; |
| 34 | + |
| 35 | + #[ORM\Column(name: "tablename", type: "string", length: 255, nullable: true)] |
| 36 | + private ?string $tableName = null; |
| 37 | + |
| 38 | + public function getName(): string |
| 39 | + { |
| 40 | + return $this->name; |
| 41 | + } |
| 42 | + |
| 43 | + public function getType(): ?string |
| 44 | + { |
| 45 | + return $this->type; |
| 46 | + } |
| 47 | + |
| 48 | + public function getListOrder(): ?int |
| 49 | + { |
| 50 | + return $this->listOrder; |
| 51 | + } |
| 52 | + |
| 53 | + public function getDefaultValue(): ?string |
| 54 | + { |
| 55 | + return $this->defaultValue; |
| 56 | + } |
| 57 | + |
| 58 | + public function isRequired(): ?bool |
| 59 | + { |
| 60 | + return $this->required; |
| 61 | + } |
| 62 | + |
| 63 | + public function getTableName(): ?string |
| 64 | + { |
| 65 | + return $this->tableName; |
| 66 | + } |
| 67 | + |
| 68 | + // Setters |
| 69 | + public function setName(string $name): self |
| 70 | + { |
| 71 | + $this->name = $name; |
| 72 | + return $this; |
| 73 | + } |
| 74 | + |
| 75 | + public function setType(?string $type): self |
| 76 | + { |
| 77 | + $this->type = $type; |
| 78 | + return $this; |
| 79 | + } |
| 80 | + |
| 81 | + public function setListOrder(?int $listOrder): self |
| 82 | + { |
| 83 | + $this->listOrder = $listOrder; |
| 84 | + return $this; |
| 85 | + } |
| 86 | + |
| 87 | + public function setDefaultValue(?string $defaultValue): self |
| 88 | + { |
| 89 | + $this->defaultValue = $defaultValue; |
| 90 | + return $this; |
| 91 | + } |
| 92 | + |
| 93 | + public function setRequired(?bool $required): self |
| 94 | + { |
| 95 | + $this->required = $required; |
| 96 | + return $this; |
| 97 | + } |
| 98 | + |
| 99 | + public function setTableName(?string $tableName): self |
| 100 | + { |
| 101 | + $this->tableName = $tableName; |
| 102 | + return $this; |
| 103 | + } |
| 104 | +} |
0 commit comments