<?php
namespace App\Admin\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* StdPages
*/
#[ORM\Table(name: 'std_blocks')]
#[ORM\Index(name: 'fk_std_blocks_std_users', columns: ['created_by'])]
#[ORM\Index(name: 'fk_std_blocks_std_users_0', columns: ['updated_by'])]
#[ORM\Entity(repositoryClass: 'App\Admin\Repository\StdBlocksRepository')]
class StdBlocks
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false, options: ['unsigned' => true, 'comment' => 'Unique identifier'])]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var string
*/
#[ORM\Column(name: 'machine_name', type: 'string', length: 50, nullable: true, unique: true, options: ['comment' => 'Unique code used in the programming to identify the block'])]
private $machineName;
/**
* @var bool
*/
#[ORM\Column(name: 'is_active', type: 'boolean', nullable: true, options: ['default' => 1, 'comment' => 'Flag that indicates if the block 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 string
*/
#[ORM\Column(name: 'name', type: 'string', length: 100, nullable: true, options: ['comment' => 'Name of the block'])]
private $name;
/**
* @var json
*/
#[ORM\Column(name: 'settings', type: 'json', nullable: true, options: ['comment' => 'Block settings'])]
private $settings = [];
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 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 getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSettings(): ?Array
{
return $this->settings;
}
public function setSettings(Array $settings): self
{
$this->settings = $settings;
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;
}
}