ProjectAttachment.php (1109B)
1 <?php 2 3 namespace PartKeepr\ProjectBundle\Entity; 4 5 use Doctrine\ORM\Mapping as ORM; 6 use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; 7 use PartKeepr\UploadedFileBundle\Entity\UploadedFile; 8 9 /** 10 * Holds a project attachment. 11 * 12 * @ORM\Entity 13 * @TargetService("/api/project_attachments") 14 **/ 15 class ProjectAttachment extends UploadedFile 16 { 17 /** 18 * Creates a new project attachment. 19 */ 20 public function __construct() 21 { 22 parent::__construct(); 23 $this->setType('ProjectAttachment'); 24 } 25 26 /** 27 * The project object. 28 * 29 * @ORM\ManyToOne(targetEntity="PartKeepr\ProjectBundle\Entity\Project", inversedBy="attachments") 30 * 31 * @var Project 32 */ 33 private $project = null; 34 35 /** 36 * Sets the project. 37 * 38 * @param Project $project The project to set 39 */ 40 public function setProject(Project $project = null) 41 { 42 $this->project = $project; 43 } 44 45 /** 46 * Returns the roject. 47 * 48 * @return Project the project 49 */ 50 public function getProject() 51 { 52 return $this->project; 53 } 54 }