<?php
namespace App\Admin\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* StdSnippetsContent
*/
#[ORM\Table(name: 'std_snippets_content')]
#[ORM\Index(name: 'fk_std_snippets_content_std_users', columns: ['created_by'])]
#[ORM\Index(name: 'fk_std_snippets_content_std_users_0', columns: ['updated_by'])]
#[ORM\Index(name: 'fk_std_snippets_content_std_languages', columns: ['language_code'])]
#[ORM\Entity(repositoryClass: 'App\Admin\Repository\StdSnippetsContentRepository')]
#[ORM\HasLifecycleCallbacks]
class StdSnippetsContent
{
/**
* @var \StdSnippets
*/
#[ORM\JoinColumn(name: 'snippet_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdSnippets', inversedBy: 'snippetsContent')]
#[ORM\Id]
private $snippetId;
/**
* @var \StdLanguages
*
*
*/
#[ORM\JoinColumn(name: 'language_code', referencedColumnName: 'language_code')]
#[ORM\ManyToOne(targetEntity: 'StdLanguages')]
#[ORM\Id]
private $languageCode;
/**
* @var bool
*/
#[ORM\Column(name: 'is_active', type: 'boolean', nullable: false, options: ['default' => 1, 'comment' => 'Flag that indicates if the content is active'])]
private $isActive = '1';
/**
* @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;
/**
* @var json
*/
#[ORM\Column(name: 'content', type: 'json', nullable: true, options: ['comment' => 'Content of the snippet'])]
private $content = [];
public function getSnippetId(): ?StdSnippets
{
return $this->snippetId;
}
public function setSnippetId(?StdSnippets $snippetId): self
{
$this->snippetId = $snippetId;
return $this;
}
public function getLanguageCode(): ?StdLanguages
{
return $this->languageCode;
}
public function setLanguageCode(?StdLanguages $languageCode): self
{
$this->languageCode = $languageCode;
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 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;
}
public function getContent(): ?Array
{
return $this->content;
}
public function setContent(?Array $content): self
{
$this->content = $content;
return $this;
}
#[ORM\PreUpdate]
public function setUpdated()
{
$this->setUpdatedDate(new \DateTime());
}
#[ORM\PrePersist]
public function setCreated()
{
$this->setUpdatedDate(new \DateTime());
$this->setCreatedDate(new \DateTime());
}
}