<?php
namespace App\Admin\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* StdDomains
*/
#[ORM\Table(name: 'std_domains')]
#[ORM\Index(name: 'FK_std_domains_std_users', columns: ['created_by'])]
#[ORM\Index(name: 'FK_std_domains_std_languages', columns: ['language_code'])]
#[ORM\Index(name: 'FK_std_domains_std_users_2', columns: ['updated_by'])]
#[ORM\Index(name: 'FK_std_domains_std_webservices', columns: ['webservice_id'])]
#[ORM\Index(name: 'FK_std_domains_std_domains', columns: ['parent_domain_id'])]
#[ORM\Index(name: 'idx_erp_code', columns: ['erp_code'])]
#[ORM\UniqueConstraint(name: 'machine_name_language_code', columns: ['machine_name', 'language_code'])]
#[ORM\Entity(repositoryClass: 'App\Admin\Repository\StdDomainsRepository')]
#[UniqueEntity(
fields: 'description',
message: 'domains_unique_domain',
)]
#[UniqueEntity(
fields: 'erpCode',
message: 'domains_unique_erpcode',
)]
class StdDomains
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var string|null
*/
#[ORM\Column(name: 'machine_name', type: 'string', length: 50, nullable: true)]
private $machineName;
/**
* @var string|null
*/
#[ORM\Column(name: 'description', type: 'string', length: 50, nullable: true)]
private $description;
/**
* @var string|null
*/
#[ORM\Column(name: 'webservice_value', type: 'string', length: 50, nullable: true)]
private $webserviceValue;
/**
* @var string|null
*/
#[ORM\Column(name: 'webservice_description', type: 'string', length: 50, nullable: true)]
private $webserviceDescription;
/**
* @var bool|null
*/
#[ORM\Column(name: 'is_active', type: 'boolean', nullable: true, options: ['default' => 1])]
private $isActive = '1';
/**
* @var \DateTime|null
*/
#[ORM\Column(name: 'created_date', type: 'datetime', nullable: true)]
private $createdDate;
/**
* @var \DateTime|null
*/
#[ORM\Column(name: 'updated_date', type: 'datetime', nullable: true)]
private $updatedDate;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'updated_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $updatedBy;
/**
* @var \StdLanguages
*/
#[ORM\JoinColumn(name: 'language_code', referencedColumnName: 'language_code')]
#[ORM\ManyToOne(targetEntity: 'StdLanguages')]
private $languageCode;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'created_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $createdBy;
/**
* @var \StdWebservices
*/
#[ORM\JoinColumn(name: 'webservice_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdWebservices')]
private $webservice;
/**
* @var StdDomains
*/
#[ORM\JoinColumn(name: 'parent_domain_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdDomains', inversedBy: 'childrenDomains')]
private $parentDomain;
/**
* @var Doctrine\Common\Collections\ArrayCollection|null
*/
#[ORM\OneToMany(targetEntity: 'StdDomains', mappedBy: 'parentDomain', cascade: ['persist'])]
private $childrenDomains;
/**
* @var Doctrine\Common\Collections\ArrayCollection|null
*/
#[ORM\OneToMany(targetEntity: 'StdDomainsContent', mappedBy: 'domain', cascade: ['persist', 'remove'], orphanRemoval: true)]
private $contents;
/**
* @var Doctrine\Common\Collections\ArrayCollection|null
*/
#[ORM\OneToMany(targetEntity: 'StdDomainsValues', mappedBy: 'domain', cascade: ['persist', 'remove'], orphanRemoval: true)]
private $values;
/**
* @var string|null
*/
#[ORM\Column(name: 'erp_code', type: 'string', length: 50, nullable: true)]
private $erpCode;
public function __construct()
{
$this->contents = new ArrayCollection();
$this->values = new ArrayCollection();
$this->childrenDomains = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getMachineName(): ?string
{
return $this->machineName;
}
public function setMachineName(?string $machineName): self
{
$this->machineName = $machineName;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getWebserviceValue(): ?string
{
return $this->webserviceValue;
}
public function setWebserviceValue(?string $webserviceValue): self
{
$this->webserviceValue = $webserviceValue;
return $this;
}
public function getWebserviceDescription(): ?string
{
return $this->webserviceDescription;
}
public function setWebserviceDescription(?string $webserviceDescription): self
{
$this->webserviceDescription = $webserviceDescription;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getCreatedDate(): ?\DateTimeInterface
{
return $this->createdDate;
}
public function setCreatedDate(?\DateTimeInterface $createdDate): self
{
$this->createdDate = $createdDate;
return $this;
}
public function getUpdatedDate(): ?\DateTimeInterface
{
return $this->updatedDate;
}
public function setUpdatedDate(?\DateTimeInterface $updatedDate): self
{
$this->updatedDate = $updatedDate;
return $this;
}
public function getUpdatedBy(): ?StdUsers
{
return $this->updatedBy;
}
public function setUpdatedBy(?StdUsers $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
public function getLanguageCode(): ?StdLanguages
{
return $this->languageCode;
}
public function setLanguageCode(?StdLanguages $languageCode): self
{
$this->languageCode = $languageCode;
return $this;
}
public function getCreatedBy(): ?StdUsers
{
return $this->createdBy;
}
public function setCreatedBy(?StdUsers $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getWebservice(): ?StdWebservices
{
return $this->webservice;
}
public function setWebservice(?StdWebservices $webservice): self
{
$this->webservice = $webservice;
return $this;
}
public function getParentDomain(): ?StdDomains
{
return $this->parentDomain;
}
public function setParentDomain(?StdDomains $parentDomain): self
{
$this->parentDomain = $parentDomain;
return $this;
}
/**
* @return Collection|StdDomainsContent[]
*/
public function getContents(): ?Collection
{
return $this->contents;
}
public function removeContent(StdDomainsContent $content): self
{
if ($this->contents->contains($content)) {
$this->contents->removeElement($content);
// set the owning side to null (unless already changed)
if ($content->getDomain() === $this) {
$content->setDomain(null);
}
}
return $this;
}
public function addContent(StdDomainsContent $content): self
{
if (!$this->contents->contains($content)) {
$this->contents[] = $content;
$content->setDomain($this);
}
return $this;
}
public function getValues(): ?Collection
{
return $this->values;
}
public function removeValue(StdDomainsValues $value): self
{
if ($this->values->contains($value)) {
$this->values->removeElement($value);
// set the owning side to null (unless already changed)
if ($value->getDomain() === $this) {
$value->setDomain(null);
}
}
return $this;
}
public function addValue(StdDomainsValues $value): self
{
if (!$this->values->contains($value)) {
$this->values[] = $value;
$value->setDomain($this);
}
return $this;
}
/**
* @return Collection|StdDomains[]
*/
public function getChildrenDomains(): ?Collection
{
return $this->childrenDomains;
}
public function __toString()
{
return $this->getDescription();
}
public function getErpCode(): ?string
{
return $this->erpCode;
}
public function setErpCode(?string $erpCode): self
{
$this->erpCode = $erpCode;
return $this;
}
}