<?php
namespace App\Admin\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* StdAttributesContent
* */
#[ORM\Table(name: 'std_attributes_content')]
#[ORM\Index(name: 'fk_std_attributes_std_users', columns: ['created_by'])]
#[ORM\Index(name: 'fk_std_attributes_std_users_0', columns: ['updated_by'])]
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
class StdAttributesContent
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false, options: ['unsigned' => true, 'comment' => 'Attribute content unique identifier'])]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var \StdAttributes
*/
#[ORM\JoinColumn(name: 'attribute_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdAttributes', inversedBy: 'contents')]
private $attribute;
/**
* @var \StdLanguages
*/
#[ORM\JoinColumn(name: 'language_code', referencedColumnName: 'language_code')]
#[ORM\ManyToOne(targetEntity: 'StdLanguages')]
private $languageCode;
/**
* @var string
*/
#[ORM\Column(name: 'name', type: 'string', length: 50, nullable: false, options: ['comment' => 'Attribute name'])]
private $name;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'created_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $createdBy;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'created_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time of the record creation'])]
private $createdDate;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'updated_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $updatedBy;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'updated_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time the record was last updated'])]
private $updatedDate;
public function getId(): ?int
{
return $this->id;
}
public function getAttribute(): ?StdAttributes
{
return $this->attribute;
}
public function setAttribute(StdAttributes $attribute): self
{
$this->attribute = $attribute;
return $this;
}
public function getLanguageCode(): ?StdLanguages
{
return $this->languageCode;
}
public function setLanguageCode(StdLanguages $languagecode): self
{
$this->languageCode = $languagecode;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
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 getCreatedBy(): ?StdUsers
{
return $this->createdBy;
}
public function setCreatedBy(?StdUsers $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getUpdatedBy(): ?StdUsers
{
return $this->updatedBy;
}
public function setUpdatedBy(?StdUsers $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
#[ORM\PreUpdate]
public function setUpdated()
{
$this->setUpdatedDate(new \DateTime());
}
#[ORM\PrePersist]
public function setCreated()
{
$this->setUpdatedDate(new \DateTime());
$this->setCreatedDate(new \DateTime());
}
public function __toString() {
return $this->name;
}
}