<?php
/**
* Created by PhpStorm.
* User: Sunendra Gajadhar
* Date: 2024-12-03
* Time: 22:58
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use DateTime;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks
* @ORM\Table(name="category")
*/
class Category
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="name", type="string", length=255)
*/
protected $name;
/**
* @ORM\Column(name="has_tvq", type="boolean", nullable=true)
*/
protected $hasTvq;
/**
* @ORM\Column(name="has_tps", type="boolean", nullable=true)
*/
protected $hasTps;
/**
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* @ORM\Column(name="modified_at", type="datetime")
*/
protected $modifiedAt;
/**
* @ORM\Column(name="modified_by", type="integer", nullable=true)
*/
protected $modifiedBy;
public function __toString()
{
return $this->getName();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getHasTvq()
{
return $this->hasTvq;
}
/**
* @param mixed $hasTvq
*/
public function setHasTvq($hasTvq = 0)
{
$this->hasTvq = $hasTvq;
}
/**
* @return mixed
*/
public function getHasTps()
{
return $this->hasTps;
}
/**
* @param mixed $hasTps
*/
public function setHasTps($hasTps = 0)
{
$this->hasTps = $hasTps;
}
/**
* @return mixed
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param mixed $createdAt
*/
public function setCreatedAt($createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return mixed
*/
public function getModifiedAt()
{
return $this->modifiedAt;
}
/**
* @param mixed $modifiedAt
*/
public function setModifiedAt($modifiedAt): void
{
$this->$modifiedAt = $modifiedAt;
}
/**
* @return mixed
*/
public function getModifiedBy()
{
return $this->modifiedBy;
}
/**
* @param mixed $modifiedBy
*/
public function setModifiedBy($modifiedBy): void
{
$this->modifiedBy = $modifiedBy;
}
// Lifecycle Callbacks
/**
* @ORM\PrePersist
*/
public function onPrePersist(): void
{
$this->createdAt = new DateTime();
$this->modifiedAt = new DateTime();
}
/**
* @ORM\PreUpdate
*/
public function onPreUpdate(): void
{
$this->modifiedAt = new DateTime();
}
}