src/Entity/System/OrderReturnLineComment.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * OrderReturn
  6.  *
  7.  * @ORM\Table(name="ps_returns_lines_comments")
  8.  *
  9.  * @ORM\Entity(repositoryClass="App\Repository\System\OrderReturnLineCommentRepository")
  10.  */
  11. class OrderReturnLineComment
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      *
  16.      * @ORM\GeneratedValue()
  17.      *
  18.      * @ORM\Column(type="integer", name="id_comment")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var OrderReturnLine
  23.      *
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\System\OrderReturnLine", inversedBy="comments")
  25.      *
  26.      * @ORM\JoinColumn(name="id_returns_lines", referencedColumnName="id_returns_lines")
  27.      */
  28.     private $returnsLine;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(type="text", nullable=true)
  33.      */
  34.     private $comments;
  35.     /**
  36.      * @var bool
  37.      *
  38.      * @ORM\Column(type="boolean", options={"default" : 0})
  39.      */
  40.     private $admin;
  41.     /**
  42.      * @var \DateTime
  43.      *
  44.      * @ORM\Column(type="datetime", nullable=true)
  45.      */
  46.     private $dateAdd;
  47.     /**
  48.      * @var Employee|null
  49.      *
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Employee", inversedBy="orderReturnLinesComments")
  51.      *
  52.      * @ORM\JoinColumn(name="employee", referencedColumnName="id_employee")
  53.      */
  54.     private ?Employee $employee;
  55.     public static function createRmaLineComments(
  56.         OrderReturnLine $rmaLine,
  57.         string $comment,
  58.         ?Employee $employee
  59.     ): OrderReturnLineComment {
  60.         $rmaLineComment = new self();
  61.         $rmaLineComment->returnsLine $rmaLine;
  62.         $rmaLineComment->comments $comment;
  63.         $rmaLineComment->admin true;
  64.         $rmaLineComment->dateAdd = new \DateTime();
  65.         $rmaLineComment->employee $employee;
  66.         return $rmaLineComment;
  67.     }
  68.     /**
  69.      * @return mixed
  70.      */
  71.     public function getId()
  72.     {
  73.         return $this->id;
  74.     }
  75.     /**
  76.      * @return string
  77.      */
  78.     public function getComments(): string
  79.     {
  80.         return $this->comments;
  81.     }
  82.     /**
  83.      * @param string $comments
  84.      */
  85.     public function setComments(string $comments): void
  86.     {
  87.         $this->comments $comments;
  88.     }
  89.     /**
  90.      * @param OrderReturnLine $returnsLine
  91.      */
  92.     public function setReturnsLine(OrderReturnLine $returnsLine): void
  93.     {
  94.         $this->returnsLine $returnsLine;
  95.     }
  96.     /**
  97.      * @param bool $admin
  98.      */
  99.     public function setAdmin(bool $admin): void
  100.     {
  101.         $this->admin $admin;
  102.     }
  103.     /**
  104.      * @return \DateTime|null
  105.      */
  106.     public function getDateAdd(): ?\DateTime
  107.     {
  108.         return $this->dateAdd;
  109.     }
  110.     /**
  111.      * @param \DateTime $dateAdd
  112.      */
  113.     public function setDateAdd(\DateTime $dateAdd): void
  114.     {
  115.         $this->dateAdd $dateAdd;
  116.     }
  117.     /**
  118.      * @return OrderReturnLine
  119.      */
  120.     public function getReturnsLine(): OrderReturnLine
  121.     {
  122.         return $this->returnsLine;
  123.     }
  124.     /**
  125.      * @return bool
  126.      */
  127.     public function isAdmin(): bool
  128.     {
  129.         return $this->admin;
  130.     }
  131.     public function getEmployee(): ?Employee
  132.     {
  133.         return $this->employee;
  134.     }
  135. }