partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

ReportProject.php (1989B)


      1 <?php
      2 
      3 namespace PartKeepr\ProjectBundle\Entity;
      4 
      5 use Doctrine\ORM\Mapping as ORM;
      6 use PartKeepr\CoreBundle\Entity\BaseEntity;
      7 use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService;
      8 use Symfony\Component\Serializer\Annotation\Groups;
      9 use Symfony\Component\Validator\Constraints as Assert;
     10 
     11 /**
     12  * Represents one project and the quantity.
     13  *
     14  * @ORM\Entity
     15  * @TargetService("/api/project_report_projects")
     16  */
     17 class ReportProject extends BaseEntity
     18 {
     19     /**
     20      * @ORM\ManyToOne(targetEntity="PartKeepr\ProjectBundle\Entity\Report",inversedBy="reportProjects")
     21      *
     22      * @var Report
     23      */
     24     private $report;
     25 
     26     /**
     27      * The project the report refers to.
     28      *
     29      * @ORM\ManyToOne(targetEntity="PartKeepr\ProjectBundle\Entity\Project")
     30      * @Groups({"default"})
     31      * @Assert\NotNull()
     32      *
     33      * @var Project
     34      */
     35     private $project;
     36 
     37     /**
     38      * Specifies the amount this project should be reported.
     39      *
     40      * @ORM\Column(type="integer")
     41      * @Groups({"default"})
     42      *
     43      * @var int
     44      */
     45     private $quantity;
     46 
     47     /**
     48      * @return mixed
     49      */
     50     public function getReport()
     51     {
     52         return $this->report;
     53     }
     54 
     55     /**
     56      * @param mixed $report
     57      *
     58      * @return ReportProject
     59      */
     60     public function setReport($report)
     61     {
     62         $this->report = $report;
     63 
     64         return $this;
     65     }
     66 
     67     /**
     68      * @return Project
     69      */
     70     public function getProject()
     71     {
     72         return $this->project;
     73     }
     74 
     75     /**
     76      * @param Project $project
     77      *
     78      * @return ReportProject
     79      */
     80     public function setProject($project)
     81     {
     82         $this->project = $project;
     83 
     84         return $this;
     85     }
     86 
     87     /**
     88      * @return int
     89      */
     90     public function getQuantity()
     91     {
     92         return $this->quantity;
     93     }
     94 
     95     /**
     96      * @param int $quantity
     97      *
     98      * @return ReportProject
     99      */
    100     public function setQuantity($quantity)
    101     {
    102         $this->quantity = $quantity;
    103 
    104         return $this;
    105     }
    106 }