<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
#[ORM\MappedSuperclass]
class BaseEntity
{
#[ORM\Column(name: 'created_at', type: 'date_immutable', nullable: true)]
protected $createdAt;
#[ORM\Column(name: 'updated_at', type: 'date_immutable', nullable: true)]
protected $updatedAt;
#[ORM\Column(name: 'created_by', type: 'string', nullable: true)]
protected $createdBy;
#[ORM\Column(name: 'updated_by', type: 'string', nullable: true)]
protected $updatedBy;
#[ORM\Column(name: 'u_date', type: 'integer', nullable: true)]
protected $uDate;
public function getCreatedAt():\DateTimeImmutable|null
{
return $this->createdAt;
}
#[ORM\PrePersist]
public function setCreatedAt($createdAt): void
{
$this->createdAt = new \DateTimeImmutable('now');
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
#[ORM\PrePersist]
#[ORM\PreUpdate]
public function setUpdatedAt($updatedAt): void
{
$this->updatedAt = new \DateTimeImmutable('now');
}
public function getCreatedBy()
{
return $this->createdBy;
}
public function setCreatedBy($createdBy): void
{
$this->createdBy = $createdBy;
}
public function getUpdatedBy()
{
return $this->updatedBy;
}
public function setUpdatedBy($updatedBy): void
{
$this->updatedBy = $updatedBy;
}
public function getUDate()
{
return $this->uDate;
}
public function setUDate($uDate): void
{
$this->uDate = $uDate;
}
public function getClassName(){
return static::class;
}
}