src/Entity/Document.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Document
  8.  *
  9.  * @ORM\Table(name="document")
  10.  * @ORM\Entity(repositoryClass="App\Repository\DocumentRepository")
  11.  */
  12. class Document
  13. {
  14.     use \Gedmo\Timestampable\Traits\TimestampableEntity;
  15.     use BlameableEntity;
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * Relative Path from s3
  26.      *
  27.      * @ORM\Column(name="s3_path", type="string", length=255)
  28.      */
  29.     private $s3Path;
  30.     /**
  31.      * Title
  32.      * @ORM\Column(name="title", type="string", length=100)
  33.      */
  34.     private $title;
  35.     /**
  36.      * Description
  37.      * @ORM\Column(name="description", type="text", nullable=true)
  38.      */
  39.     private $description;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity="App\Entity\DocumentUserRights", mappedBy="document", cascade={"all"}, orphanRemoval=true)
  42.      */
  43.     private $userRights;
  44.     /**
  45.      * @var Collection
  46.      * @ORM\OneToMany(targetEntity="App\Entity\DocumentCompanyRights", mappedBy="document", cascade={"all"}, orphanRemoval=true)
  47.      */
  48.     private $companyRights;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\Event", inversedBy="documents")
  51.      * @ORM\JoinColumn(name="event_id", referencedColumnName="id")
  52.      */
  53.     private $event;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity="App\Entity\RequestForProposal", inversedBy="documents")
  56.      * @ORM\JoinColumn(name="rfp_id", referencedColumnName="id")
  57.      */
  58.     private $rfp;
  59.     /**
  60.      * @var int
  61.      * @ORM\Column(name="work_order_id", type="integer", nullable=true)
  62.      */
  63.     private $workOrderId;
  64.     /**
  65.      * @ORM\Column(name="position", type="integer", nullable=true)
  66.      */
  67.     private $position;
  68.     public function __construct()
  69.     {
  70.         $this->userRights = new ArrayCollection();
  71.         $this->companyRights = new ArrayCollection();
  72.     }
  73.     public function __toString()
  74.     {
  75.         return $this->getTitle();
  76.     }
  77.     /**
  78.      * @return mixed
  79.      */
  80.     public function getTitle()
  81.     {
  82.         return $this->title;
  83.     }
  84.     /**
  85.      * @param mixed $title
  86.      */
  87.     public function setTitle($title)
  88.     {
  89.         $this->title $title;
  90.     }
  91.     /**
  92.      * Get id
  93.      *
  94.      * @return integer
  95.      */
  96.     public function getId()
  97.     {
  98.         return $this->id;
  99.     }
  100.     /**
  101.      * Get s3Path
  102.      *
  103.      * @return string
  104.      */
  105.     public function getS3Path()
  106.     {
  107.         return $this->s3Path;
  108.     }
  109.     /**
  110.      * Set s3Path
  111.      *
  112.      * @param string $s3Path
  113.      *
  114.      * @return Document
  115.      */
  116.     public function setS3Path($s3Path)
  117.     {
  118.         $this->s3Path $s3Path;
  119.         return $this;
  120.     }
  121.     /**
  122.      * Get event
  123.      *
  124.      * @return Event
  125.      */
  126.     public function getEvent()
  127.     {
  128.         return $this->event;
  129.     }
  130.     /**
  131.      * Set event
  132.      *
  133.      * @param Event $event
  134.      *
  135.      * @return Document
  136.      */
  137.     public function setEvent(Event $event null)
  138.     {
  139.         $this->event $event;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get rfp
  144.      * @return RequestForProposal
  145.      */
  146.     public function getRfp()
  147.     {
  148.         return $this->rfp;
  149.     }
  150.     /**
  151.      * Set rfp
  152.      * @param RequestForProposal $rfp
  153.      * @return Document
  154.      */
  155.     public function setRfp(RequestForProposal $rfp null)
  156.     {
  157.         $this->rfp $rfp;
  158.         return $this;
  159.     }
  160.     public function toString(): string
  161.     {
  162.         return "{id=" $this->id "}";
  163.     }
  164.     /**
  165.      * Add userRight
  166.      *
  167.      * @param DocumentUserRights $userRight
  168.      *
  169.      * @return Document
  170.      */
  171.     public function addUserRight(DocumentUserRights $userRight)
  172.     {
  173.         $userRight->setDocument($this);
  174.         $this->userRights[] = $userRight;
  175.         return $this;
  176.     }
  177.     /**
  178.      * Remove userRight
  179.      *
  180.      * @param DocumentUserRights $userRight
  181.      */
  182.     public function removeUserRight(DocumentUserRights $userRight)
  183.     {
  184.         $this->userRights->removeElement($userRight);
  185.     }
  186.     /**
  187.      * Get userRights
  188.      *
  189.      * @return Collection
  190.      */
  191.     public function getUserRights()
  192.     {
  193.         return $this->userRights;
  194.     }
  195.     /**
  196.      * Add groupRight
  197.      *
  198.      * @param DocumentCompanyRights $companyRights
  199.      * @return Document
  200.      */
  201.     public function addCompanyRight(DocumentCompanyRights $companyRights)
  202.     {
  203.         $companyRights->setDocument($this);
  204.         $this->companyRights[] = $companyRights;
  205.         return $this;
  206.     }
  207.     /**
  208.      * Remove groupRight
  209.      *
  210.      * @param DocumentCompanyRights $companyRights
  211.      */
  212.     public function removeCompanyRight(DocumentCompanyRights $companyRights)
  213.     {
  214.         $this->companyRights->removeElement($companyRights);
  215.     }
  216.     /**
  217.      * Get groupRights
  218.      *
  219.      * @return Collection
  220.      */
  221.     public function getCompanyRights()
  222.     {
  223.         return $this->companyRights;
  224.     }
  225.     /**
  226.      * @return mixed
  227.      */
  228.     public function getDescription()
  229.     {
  230.         return $this->description;
  231.     }
  232.     /**
  233.      * @param mixed $description
  234.      */
  235.     public function setDescription($description)
  236.     {
  237.         $this->description $description;
  238.     }
  239.     /**
  240.      * @return int|null
  241.      */
  242.     public function getWorkOrderId(): ?int
  243.     {
  244.         return $this->workOrderId;
  245.     }
  246.     /**
  247.      * @param int|null $workOrderId
  248.      */
  249.     public function setWorkOrderId(int $workOrderId null)
  250.     {
  251.         $this->workOrderId $workOrderId;
  252.     }
  253.     /**
  254.      * @return mixed
  255.      */
  256.     public function getPosition()
  257.     {
  258.         return $this->position;
  259.     }
  260.     /**
  261.      * @param integer $position
  262.      */
  263.     public function setPosition($position): void
  264.     {
  265.         $this->position $position;
  266.     }
  267. }