for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* AnimeDb package.
*
* @author Peter Gribanov <[email protected]>
* @copyright Copyright (c) 2011, Peter Gribanov
* @license http://opensource.org/licenses/GPL-3.0 GPL v3
*/
namespace AnimeDb\Bundle\AppBundle\Service\Downloader\Entity;
abstract class BaseEntity implements EntityInterface
{
* @var string
private $filename = '';
* @var array
private $old_filenames = [];
* @return string
public function getFilename()
return $this->filename;
}
* @param string $filename
public function setFilename($filename)
// copy current file to the old files for remove it later
if ($this->filename) {
$this->old_filenames[] = $this->filename;
$this->filename = $filename;
* @return array
public function getOldFilenames()
return $this->old_filenames;
public function getDownloadPath()
return 'media';
public function getWebPath()
return $this->getFilename() ? sprintf('/%s/%s', $this->getDownloadPath(), $this->getFilename()) : '';