/** * @param string $filename */ public function setFilename($filename) { // it is a filename prefix, not a suffix for the download path if (strpos($filename, 'tmp/') !== 0) { $filename = 'tmp/' . date('Ymd') . '/' . $filename; } parent::setFilename($filename); }
/** * @return string */ public function getDownloadPath() { return parent::getDownloadPath() . '/plugin/' . $this->getName(); }
public function testGetWebPath() { $this->assertEmpty($this->entity->getWebPath()); $this->entity->setFilename('foo'); $this->assertEquals('/media/foo', $this->entity->getWebPath()); }
/** * @param string $filename * * @return Item */ public function setFilename($filename) { $this->cover = $filename; parent::setFilename($filename); return $this; }