src/Entity/InstanceView.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InstanceViewRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=InstanceViewRepository::class)
  7.  * @ORM\Table(name="instance_view", uniqueConstraints={
  8.  *     @ORM\UniqueConstraint(name="uniq_view_per_instance", columns={"instance_id", "name"})
  9.  * })
  10.  */
  11. class InstanceView
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=Instance::class)
  21.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  22.      */
  23.     private $instance;
  24.     /**
  25.      * @ORM\Column(type="string", length=180)
  26.      */
  27.     private $name;
  28.     /**
  29.      * @ORM\Column(type="string", length=180, nullable=true)
  30.      */
  31.     private $displayName;
  32.     /**
  33.      * @ORM\Column(name="row_pos", type="integer", options={"default" = 1})
  34.      */
  35.     private $row 1;
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     private $glbPath;
  40.     /**
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      */
  43.     private $meshGroupName;
  44.     /**
  45.      * @ORM\Column(type="json", nullable=true)
  46.      */
  47.     private $meshPropertyMap;
  48.     /**
  49.      * @ORM\Column(type="boolean")
  50.      */
  51.     private $isDefault false;
  52.     /**
  53.      * @ORM\Column(type="boolean", options={"default" = 0})
  54.      */
  55.     private $showOnHomepage false;
  56.     /**
  57.      * @ORM\Column(name="sort_order", type="integer", options={"default" = 0})
  58.      */
  59.     private $sortOrder 0;
  60.     /**
  61.      * @ORM\Column(type="string", length=100, nullable=true)
  62.      */
  63.     private $icon;
  64.     /**
  65.      * @ORM\Column(type="datetime_immutable")
  66.      */
  67.     private $createdAt;
  68.     /**
  69.      * @ORM\Column(type="datetime_immutable")
  70.      */
  71.     private $updatedAt;
  72.     public function __construct()
  73.     {
  74.         $now = new \DateTimeImmutable();
  75.         $this->createdAt $now;
  76.         $this->updatedAt $now;
  77.     }
  78.     public function getId(): ?int
  79.     {
  80.         return $this->id;
  81.     }
  82.     public function getInstance(): ?Instance
  83.     {
  84.         return $this->instance;
  85.     }
  86.     public function setInstance(Instance $instance): self
  87.     {
  88.         $this->instance $instance;
  89.         return $this;
  90.     }
  91.     public function getName(): ?string
  92.     {
  93.         return $this->name;
  94.     }
  95.     public function setName(string $name): self
  96.     {
  97.         $this->name $name;
  98.         return $this;
  99.     }
  100.     public function getDisplayName(): ?string
  101.     {
  102.         return $this->displayName ?? $this->name;
  103.     }
  104.     public function setDisplayName(?string $displayName): self
  105.     {
  106.         $this->displayName $displayName;
  107.         return $this;
  108.     }
  109.     public function getRow(): int
  110.     {
  111.         return $this->row ?? 1;
  112.     }
  113.     public function setRow(int $row): self
  114.     {
  115.         if ($row <= 0) {
  116.             $row 1;
  117.         }
  118.         $this->row $row;
  119.         return $this;
  120.     }
  121.     public function getGlbPath(): ?string
  122.     {
  123.         return $this->glbPath;
  124.     }
  125.     public function setGlbPath(?string $glbPath): self
  126.     {
  127.         $this->glbPath $glbPath;
  128.         return $this;
  129.     }
  130.     public function getMeshGroupName(): ?string
  131.     {
  132.         return $this->meshGroupName;
  133.     }
  134.     public function setMeshGroupName(?string $meshGroupName): self
  135.     {
  136.         $this->meshGroupName $meshGroupName;
  137.         return $this;
  138.     }
  139.     public function getMeshPropertyMap(): ?array
  140.     {
  141.         return $this->meshPropertyMap;
  142.     }
  143.     public function setMeshPropertyMap(?array $meshPropertyMap): self
  144.     {
  145.         $this->meshPropertyMap $meshPropertyMap;
  146.         return $this;
  147.     }
  148.     public function isDefault(): bool
  149.     {
  150.         return (bool) $this->isDefault;
  151.     }
  152.     public function setIsDefault(bool $isDefault): self
  153.     {
  154.         $this->isDefault $isDefault;
  155.         return $this;
  156.     }
  157.     public function isShowOnHomepage(): bool
  158.     {
  159.         return (bool) $this->showOnHomepage;
  160.     }
  161.     public function setShowOnHomepage(bool $showOnHomepage): self
  162.     {
  163.         $this->showOnHomepage $showOnHomepage;
  164.         return $this;
  165.     }
  166.     public function getSortOrder(): int
  167.     {
  168.         return $this->sortOrder ?? 0;
  169.     }
  170.     public function setSortOrder(int $sortOrder): self
  171.     {
  172.         $this->sortOrder $sortOrder;
  173.         return $this;
  174.     }
  175.     public function getIcon(): ?string
  176.     {
  177.         return $this->icon;
  178.     }
  179.     public function setIcon(?string $icon): self
  180.     {
  181.         $this->icon $icon;
  182.         return $this;
  183.     }
  184.     public function getCreatedAt(): \DateTimeImmutable
  185.     {
  186.         return $this->createdAt;
  187.     }
  188.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  189.     {
  190.         $this->createdAt $createdAt;
  191.         return $this;
  192.     }
  193.     public function getUpdatedAt(): \DateTimeImmutable
  194.     {
  195.         return $this->updatedAt;
  196.     }
  197.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  198.     {
  199.         $this->updatedAt $updatedAt;
  200.         return $this;
  201.     }
  202. }