<?php
namespace App\Entity\System;
use Doctrine\ORM\Mapping as ORM;
/**
* OrderReturn
*
* @ORM\Table(name="ps_returns_lines_comments")
*
* @ORM\Entity(repositoryClass="App\Repository\System\OrderReturnLineCommentRepository")
*/
class OrderReturnLineComment
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer", name="id_comment")
*/
private $id;
/**
* @var OrderReturnLine
*
* @ORM\ManyToOne(targetEntity="App\Entity\System\OrderReturnLine", inversedBy="comments")
*
* @ORM\JoinColumn(name="id_returns_lines", referencedColumnName="id_returns_lines")
*/
private $returnsLine;
/**
* @var string
*
* @ORM\Column(type="text", nullable=true)
*/
private $comments;
/**
* @var bool
*
* @ORM\Column(type="boolean", options={"default" : 0})
*/
private $admin;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateAdd;
/**
* @var Employee|null
*
* @ORM\ManyToOne(targetEntity="App\Entity\System\Employee", inversedBy="orderReturnLinesComments")
*
* @ORM\JoinColumn(name="employee", referencedColumnName="id_employee")
*/
private ?Employee $employee;
public static function createRmaLineComments(
OrderReturnLine $rmaLine,
string $comment,
?Employee $employee
): OrderReturnLineComment {
$rmaLineComment = new self();
$rmaLineComment->returnsLine = $rmaLine;
$rmaLineComment->comments = $comment;
$rmaLineComment->admin = true;
$rmaLineComment->dateAdd = new \DateTime();
$rmaLineComment->employee = $employee;
return $rmaLineComment;
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getComments(): string
{
return $this->comments;
}
/**
* @param string $comments
*/
public function setComments(string $comments): void
{
$this->comments = $comments;
}
/**
* @param OrderReturnLine $returnsLine
*/
public function setReturnsLine(OrderReturnLine $returnsLine): void
{
$this->returnsLine = $returnsLine;
}
/**
* @param bool $admin
*/
public function setAdmin(bool $admin): void
{
$this->admin = $admin;
}
/**
* @return \DateTime|null
*/
public function getDateAdd(): ?\DateTime
{
return $this->dateAdd;
}
/**
* @param \DateTime $dateAdd
*/
public function setDateAdd(\DateTime $dateAdd): void
{
$this->dateAdd = $dateAdd;
}
/**
* @return OrderReturnLine
*/
public function getReturnsLine(): OrderReturnLine
{
return $this->returnsLine;
}
/**
* @return bool
*/
public function isAdmin(): bool
{
return $this->admin;
}
public function getEmployee(): ?Employee
{
return $this->employee;
}
}