<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Document
*
* @ORM\Table(name="document")
* @ORM\Entity(repositoryClass="App\Repository\DocumentRepository")
*/
class Document
{
use \Gedmo\Timestampable\Traits\TimestampableEntity;
use BlameableEntity;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* Relative Path from s3
*
* @ORM\Column(name="s3_path", type="string", length=255)
*/
private $s3Path;
/**
* Title
* @ORM\Column(name="title", type="string", length=100)
*/
private $title;
/**
* Description
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DocumentUserRights", mappedBy="document", cascade={"all"}, orphanRemoval=true)
*/
private $userRights;
/**
* @var Collection
* @ORM\OneToMany(targetEntity="App\Entity\DocumentCompanyRights", mappedBy="document", cascade={"all"}, orphanRemoval=true)
*/
private $companyRights;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Event", inversedBy="documents")
* @ORM\JoinColumn(name="event_id", referencedColumnName="id")
*/
private $event;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\RequestForProposal", inversedBy="documents")
* @ORM\JoinColumn(name="rfp_id", referencedColumnName="id")
*/
private $rfp;
/**
* @var int
* @ORM\Column(name="work_order_id", type="integer", nullable=true)
*/
private $workOrderId;
/**
* @ORM\Column(name="position", type="integer", nullable=true)
*/
private $position;
public function __construct()
{
$this->userRights = new ArrayCollection();
$this->companyRights = new ArrayCollection();
}
public function __toString()
{
return $this->getTitle();
}
/**
* @return mixed
*/
public function getTitle()
{
return $this->title;
}
/**
* @param mixed $title
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Get s3Path
*
* @return string
*/
public function getS3Path()
{
return $this->s3Path;
}
/**
* Set s3Path
*
* @param string $s3Path
*
* @return Document
*/
public function setS3Path($s3Path)
{
$this->s3Path = $s3Path;
return $this;
}
/**
* Get event
*
* @return Event
*/
public function getEvent()
{
return $this->event;
}
/**
* Set event
*
* @param Event $event
*
* @return Document
*/
public function setEvent(Event $event = null)
{
$this->event = $event;
return $this;
}
/**
* Get rfp
* @return RequestForProposal
*/
public function getRfp()
{
return $this->rfp;
}
/**
* Set rfp
* @param RequestForProposal $rfp
* @return Document
*/
public function setRfp(RequestForProposal $rfp = null)
{
$this->rfp = $rfp;
return $this;
}
public function toString(): string
{
return "{id=" . $this->id . "}";
}
/**
* Add userRight
*
* @param DocumentUserRights $userRight
*
* @return Document
*/
public function addUserRight(DocumentUserRights $userRight)
{
$userRight->setDocument($this);
$this->userRights[] = $userRight;
return $this;
}
/**
* Remove userRight
*
* @param DocumentUserRights $userRight
*/
public function removeUserRight(DocumentUserRights $userRight)
{
$this->userRights->removeElement($userRight);
}
/**
* Get userRights
*
* @return Collection
*/
public function getUserRights()
{
return $this->userRights;
}
/**
* Add groupRight
*
* @param DocumentCompanyRights $companyRights
* @return Document
*/
public function addCompanyRight(DocumentCompanyRights $companyRights)
{
$companyRights->setDocument($this);
$this->companyRights[] = $companyRights;
return $this;
}
/**
* Remove groupRight
*
* @param DocumentCompanyRights $companyRights
*/
public function removeCompanyRight(DocumentCompanyRights $companyRights)
{
$this->companyRights->removeElement($companyRights);
}
/**
* Get groupRights
*
* @return Collection
*/
public function getCompanyRights()
{
return $this->companyRights;
}
/**
* @return mixed
*/
public function getDescription()
{
return $this->description;
}
/**
* @param mixed $description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return int|null
*/
public function getWorkOrderId(): ?int
{
return $this->workOrderId;
}
/**
* @param int|null $workOrderId
*/
public function setWorkOrderId(int $workOrderId = null)
{
$this->workOrderId = $workOrderId;
}
/**
* @return mixed
*/
public function getPosition()
{
return $this->position;
}
/**
* @param integer $position
*/
public function setPosition($position): void
{
$this->position = $position;
}
}