| 1 | <?php |
||
| 11 | abstract class BaseEntity implements EntityInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | private $filename = ''; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | private $old_filenames = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | 7 | public function getFilename() |
|
| 27 | { |
||
| 28 | 7 | return $this->filename; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param string $filename |
||
| 33 | */ |
||
| 34 | 7 | public function setFilename($filename) |
|
| 35 | { |
||
| 36 | // copy current file to the old files for remove it later |
||
| 37 | 7 | if ($this->filename) { |
|
| 38 | 3 | $this->old_filenames[] = $this->filename; |
|
| 39 | } |
||
| 40 | 7 | $this->filename = $filename; |
|
| 41 | 7 | } |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @return array |
||
| 45 | */ |
||
| 46 | 3 | public function getOldFilenames() |
|
| 47 | { |
||
| 48 | 3 | return $this->old_filenames; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | 4 | public function getDownloadPath() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | 2 | public function getWebPath() |
|
| 66 | } |
||
| 67 |