WIP : Upload management

This commit is contained in:
gmorel
2013-09-18 10:07:57 +02:00
parent 9e927c40be
commit 3627d96175
6 changed files with 234 additions and 0 deletions

View File

@@ -25,4 +25,48 @@ class CategoryImage extends BaseCategoryImage
return true;
}
/**
* Get picture absolute path
*
* @return null|string
*/
public function getAbsolutePath()
{
return null === $this->file
? null
: $this->getUploadRootDir().'/'.$this->file;
}
/**
* Get picture web path
*
* @return null|string
*/
public function getWebPath()
{
return null === $this->file
? null
: $this->getUploadDir().'/'.$this->file;
}
/**
* The absolute directory path where uploaded
* documents should be saved
* @return string
*/
protected function getUploadRootDir()
{
return __DIR__.'/../../../../../'.$this->getUploadDir();
}
/**
* Get rid of the __DIR__ so it doesn't screw up
* when displaying uploaded doc/image in the view.
* @return string
*/
protected function getUploadDir()
{
return 'local/media/images/category';
}
}