1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- namespace Uploadable\Fixture\Entity;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * @ORM\Entity
- * @Gedmo\Uploadable(allowOverwrite=true, pathMethod="getPath", callback="callbackMethod")
- */
- class File
- {
- /**
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @ORM\Column(name="title", type="string", nullable=true)
- */
- private $title;
- /**
- * @ORM\Column(name="path", type="string")
- * @Gedmo\UploadableFilePath
- */
- private $filePath;
- /**
- * @ORM\ManyToOne(targetEntity="Article", inversedBy="files")
- * @ORM\JoinColumn(name="article_id", referencedColumnName="id")
- */
- private $article;
- public $callbackWasCalled = false;
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function setFilePath($filePath)
- {
- $this->filePath = $filePath;
- }
- public function getFilePath()
- {
- return $this->filePath;
- }
- public function setArticle(Article $article)
- {
- $this->article = $article;
- }
- public function getArticle()
- {
- return $this->article;
- }
- public function callbackMethod()
- {
- $this->callbackWasCalled = true;
- }
- public function getPath()
- {
- return __DIR__.'/../../../../temp/uploadable';
- }
- }
|