src/Entity/RequestForProposal.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. use DateTime;
  7. /**
  8.  * @ORM\Entity
  9.  * @ORM\Entity(repositoryClass="App\Repository\RequestForProposalRepository")
  10.  * @ORM\Table(name="request_for_proposal")
  11.  */
  12. class RequestForProposal
  13. {
  14.     use TimestampableEntity;
  15.     use BlameableEntity;
  16.     /**
  17.     /**
  18.      * @var int|null
  19.      * @ORM\Id
  20.      * @ORM\Column(type="integer")
  21.      * @ORM\GeneratedValue
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var string
  26.      * @ORM\Column(name="title", type="string")
  27.      */
  28.     private $title;
  29.     /**
  30.      * @var string
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $content;
  34.     /**
  35.      * @ORM\Column(name="deadline", type="date")
  36.      */
  37.     private $deadline;
  38.     /**
  39.      * @ORM\Column(name="deadline_state_interest", type="date", nullable=true)
  40.      */
  41.     private $deadlineStateInterest;
  42.     /**
  43.      * @ORM\Column(name="response_documents_allowed", type="boolean", nullable=true)
  44.      */
  45.     private $responseDocumentsAllowed;
  46.     /**
  47.      * @var ArrayCollection
  48.      * @ORM\ManyToMany(targetEntity="App\Entity\RequestForProposalResponseDocument", cascade={"persist"})
  49.      * @ORM\JoinTable(name="request_for_proposal_response_documents_collection",
  50.      *     joinColumns={@ORM\JoinColumn(name="rfp_id", referencedColumnName="id")},
  51.      *     inverseJoinColumns={@ORM\JoinColumn(name="response_document_id", referencedColumnName="id")}
  52.      * )
  53.      */
  54.     private $responseDocuments;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity="App\Entity\Document", mappedBy="rfp")
  57.      */
  58.     private $documents;
  59.     /**
  60.      * @var Collection
  61.      * @ORM\OneToMany(targetEntity="App\Entity\RequestForProposalCompanyRights", mappedBy="rfp", cascade={"all"}, orphanRemoval=true)
  62.      */
  63.     private $companyRights;
  64.     /**
  65.      * @var Collection
  66.      * @ORM\OneToMany(targetEntity="App\Entity\RequestForProposalGroupRights", mappedBy="rfp", cascade={"all"}, orphanRemoval=true)
  67.      */
  68.     private $groupRights;
  69.     /**
  70.      * @var Collection
  71.      * @ORM\OneToMany(targetEntity="App\Entity\RequestForProposalInterest", mappedBy="rfp", cascade={"all"}, orphanRemoval=true)
  72.      */
  73.     private $interests;
  74.     /**
  75.      * @var Collection
  76.      * @ORM\OneToMany(targetEntity="App\Entity\RequestForProposalResponseDocumentAnswer", mappedBy="rfp", cascade={"all"}, orphanRemoval=true)
  77.      */
  78.     private $responseDocumentAnswers;
  79.     /**
  80.      * @var Provider
  81.      * @ORM\ManyToOne(targetEntity="App\Entity\Provider", inversedBy="rfps")
  82.      * @ORM\JoinColumn(name="provider_id", referencedColumnName="id")
  83.      */
  84.     private $provider;
  85.     public function __construct()
  86.     {
  87.         $this->companyRights = new ArrayCollection();
  88.         $this->groupRights = new ArrayCollection();
  89.         $this->interests = new ArrayCollection();
  90.         $this->documents = new ArrayCollection();
  91.         $this->responseDocuments = new ArrayCollection();
  92.         $this->responseDocumentAnswers = new ArrayCollection();
  93.     }
  94.     /**
  95.      * @return string
  96.      */
  97.     public function __toString(): string
  98.     {
  99.         return (string)$this->title;
  100.     }
  101.     public function toString(): string
  102.     {
  103.         return "{id=" $this->id ",title=" $this->title "}";
  104.     }
  105.     /**
  106.      * @return int|null
  107.      */
  108.     public function getId(): ?int
  109.     {
  110.         return $this->id;
  111.     }
  112.     /**
  113.      * @return string
  114.      */
  115.     public function getTitle(): ?string
  116.     {
  117.         return $this->title;
  118.     }
  119.     /**
  120.      * @param string|null $title
  121.      *
  122.      * @return self
  123.      */
  124.     public function setTitle(?string $title): self
  125.     {
  126.         $this->title $title;
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return string
  131.      */
  132.     public function getContent(): ?string
  133.     {
  134.         return $this->content;
  135.     }
  136.     /**
  137.      * @param string|null $content
  138.      *
  139.      * @return self
  140.      */
  141.     public function setContent(?string $content): self
  142.     {
  143.         $this->content $content;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return DateTime|null
  148.      */
  149.     public function getDeadline(): ?DateTime
  150.     {
  151.         return $this->deadline;
  152.     }
  153.     /**
  154.      * @param DateTime|null $deadline
  155.      */
  156.     public function setDeadline(?DateTime $deadline)
  157.     {
  158.         $this->deadline $deadline;
  159.     }
  160.     /**
  161.      * @return DateTime|null
  162.      */
  163.     public function getDeadlineStateInterest(): ?DateTime
  164.     {
  165.         return $this->deadlineStateInterest;
  166.     }
  167.     /**
  168.      * @param DateTime|null $deadlineStateInterest
  169.      */
  170.     public function setDeadlineStateInterest(?DateTime $deadlineStateInterest)
  171.     {
  172.         $this->deadlineStateInterest $deadlineStateInterest;
  173.     }
  174.     /**
  175.      * Get provider
  176.      *
  177.      * @return Provider
  178.      */
  179.     public function getProvider()
  180.     {
  181.         return $this->provider;
  182.     }
  183.     /**
  184.      * Set provider
  185.      *
  186.      * @param Provider $provider
  187.      *
  188.      * @return Provider
  189.      */
  190.     public function setProvider(Provider $provider null)
  191.     {
  192.         $this->provider $provider;
  193.         return $this;
  194.     }
  195.     /**
  196.      * Add document
  197.      * @param Document $document
  198.      * @return RequestForProposal
  199.      */
  200.     public function addDocument(Document $document)
  201.     {
  202.         $document->setRfp($this);
  203.         $this->documents[] = $document;
  204.         return $this;
  205.     }
  206.     /**
  207.      * Remove document
  208.      * @param Document $document
  209.      */
  210.     public function removeDocument(Document $document)
  211.     {
  212.         $this->documents->removeElement($document);
  213.     }
  214.     /**
  215.      * Get documents
  216.      * @return Collection
  217.      */
  218.     public function getDocuments()
  219.     {
  220.         return $this->documents;
  221.     }
  222.     /**
  223.      * Add groupRight
  224.      *
  225.      * @param RequestForProposalCompanyRights $companyRights
  226.      * @return RequestForProposal
  227.      */
  228.     public function addCompanyRight(RequestForProposalCompanyRights $companyRights)
  229.     {
  230.         $companyRights->setRfp($this);
  231.         $this->companyRights[] = $companyRights;
  232.         return $this;
  233.     }
  234.     /**
  235.      * Remove groupRight
  236.      *
  237.      * @param RequestForProposalCompanyRights $companyRights
  238.      */
  239.     public function removeCompanyRight(RequestForProposalCompanyRights $companyRights)
  240.     {
  241.         $this->companyRights->removeElement($companyRights);
  242.     }
  243.     /**
  244.      * Get groupRights
  245.      *
  246.      * @return Collection
  247.      */
  248.     public function getCompanyRights()
  249.     {
  250.         return $this->companyRights;
  251.     }
  252.     /**
  253.      * Add groupRight
  254.      *
  255.      * @param RequestForProposalGroupRights $groupRights
  256.      * @return RequestForProposal
  257.      */
  258.     public function addGroupRight(RequestForProposalGroupRights $groupRights)
  259.     {
  260.         $groupRights->setRfp($this);
  261.         $this->groupRights[] = $groupRights;
  262.         return $this;
  263.     }
  264.     /**
  265.      * Remove groupRight
  266.      *
  267.      * @param RequestForProposalGroupRights $groupRights
  268.      */
  269.     public function removeGroupRight(RequestForProposalGroupRights $groupRights)
  270.     {
  271.         $this->groupRights->removeElement($groupRights);
  272.     }
  273.     /**
  274.      * Get groupRights
  275.      *
  276.      * @return Collection
  277.      */
  278.     public function getGroupRights()
  279.     {
  280.         return $this->groupRights;
  281.     }
  282.     /**
  283.      * Add interest
  284.      *
  285.      * @param RequestForProposalInterest $interest
  286.      * @return RequestForProposal
  287.      */
  288.     public function addInterest(RequestForProposalInterest $interest)
  289.     {
  290.         $interest->setRfp($this);
  291.         $this->interests[] = $interest;
  292.         return $this;
  293.     }
  294.     /**
  295.      * Remove interest
  296.      *
  297.      * @param RequestForProposalInterest $interest
  298.      */
  299.     public function removeInterest(RequestForProposalInterest $interest)
  300.     {
  301.         $this->interests->removeElement($interest);
  302.     }
  303.     /**
  304.      * Get interest
  305.      *
  306.      * @return Collection
  307.      */
  308.     public function getInterests()
  309.     {
  310.         return $this->interests;
  311.     }
  312.     /**
  313.      * @return boolean
  314.      */
  315.     public function getResponseDocumentsAllowed()
  316.     {
  317.         return $this->responseDocumentsAllowed;
  318.     }
  319.     /**
  320.      * @param boolean $responseDocumentsAllowed
  321.      * @return RequestForProposal
  322.      */
  323.     public function setResponseDocumentsAllowed($responseDocumentsAllowed)
  324.     {
  325.         $this->responseDocumentsAllowed $responseDocumentsAllowed;
  326.         return $this;
  327.     }
  328.     /**
  329.      * Add response document
  330.      *
  331.      * @param RequestForProposalResponseDocument $responseDocument
  332.      *
  333.      * @return RequestForProposal
  334.      */
  335.     public function addResponseDocument(RequestForProposalResponseDocument $responseDocument)
  336.     {
  337.         $this->responseDocuments[] = $responseDocument;
  338.         return $this;
  339.     }
  340.     /**
  341.      * Remove response document
  342.      *
  343.      * @param RequestForProposalResponseDocument $responseDocument
  344.      */
  345.     public function removeResponseDocument(RequestForProposalResponseDocument $responseDocument)
  346.     {
  347.         $this->responseDocuments->removeElement($responseDocument);
  348.     }
  349.     /**
  350.      * Get response documents
  351.      *
  352.      * @return Collection
  353.      */
  354.     public function getResponseDocuments()
  355.     {
  356.         return $this->responseDocuments;
  357.     }
  358.     /**
  359.      * Add response document answer
  360.      *
  361.      * @param RequestForProposalResponseDocumentAnswer $responseDocumentAnswer
  362.      * @return RequestForProposal
  363.      */
  364.     public function addResponseDocumentAnswer(RequestForProposalResponseDocumentAnswer $responseDocumentAnswer)
  365.     {
  366.         $responseDocumentAnswer->setRfp($this);
  367.         $this->responseDocumentAnswers[] = $responseDocumentAnswer;
  368.         return $this;
  369.     }
  370.     /**
  371.      * Remove responseDocumentAnswer
  372.      *
  373.      * @param RequestForProposalResponseDocumentAnswer $responseDocumentAnswer
  374.      */
  375.     public function removeResponseDocumentAnswer(RequestForProposalResponseDocumentAnswer $responseDocumentAnswer)
  376.     {
  377.         $this->responseDocumentAnswers->removeElement($responseDocumentAnswer);
  378.     }
  379.     /**
  380.      * Get responseDocumentAnswer
  381.      *
  382.      * @return Collection
  383.      */
  384.     public function getResponseDocumentAnswers()
  385.     {
  386.         return $this->responseDocumentAnswers;
  387.     }
  388. }