Working : Image management set on Category
This commit is contained in:
@@ -29,40 +29,17 @@ class CategoryImage extends BaseCategoryImage
|
||||
}
|
||||
|
||||
/**
|
||||
* Get picture absolute path
|
||||
* @todo refactor make all pictures using propel inheritance and factorise image behaviour into one single clean action
|
||||
* Set Image parent id
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getAbsolutePath()
|
||||
{
|
||||
return null === $this->file
|
||||
? null
|
||||
: $this->getUploadDir().'/'.$this->file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get picture web path
|
||||
* @todo refactor make all pictures using propel inheritance and factorise image behaviour into one single clean action
|
||||
* @param int $parentId parent id
|
||||
*
|
||||
* @return null|string
|
||||
* @return $this
|
||||
*/
|
||||
public function getWebPath()
|
||||
public function setParentId($parentId)
|
||||
{
|
||||
return null === $this->file
|
||||
? null
|
||||
: $this->getUploadDir().'/'.$this->file;
|
||||
}
|
||||
$this->setCategoryId($parentId);
|
||||
|
||||
|
||||
/**
|
||||
* Get rid of the __DIR__ so it doesn't screw up
|
||||
* when displaying uploaded doc/image in the view.
|
||||
* @return string
|
||||
*/
|
||||
public function getUploadDir()
|
||||
{
|
||||
return THELIA_LOCAL_DIR . 'media/images/category';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,20 @@ class ContentImage extends BaseContentImage
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Image parent id
|
||||
*
|
||||
* @param int $parentId parent id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentId($parentId)
|
||||
{
|
||||
$this->setContentId($parentId);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image parent id
|
||||
*
|
||||
|
||||
@@ -26,6 +26,20 @@ class FolderImage extends BaseFolderImage
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Image parent id
|
||||
*
|
||||
* @param int $parentId parent id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentId($parentId)
|
||||
{
|
||||
$this->setFolderId($parentId);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image parent id
|
||||
*
|
||||
|
||||
@@ -26,6 +26,20 @@ class ProductImage extends BaseProductImage
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Image parent id
|
||||
*
|
||||
* @param int $parentId parent id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentId($parentId)
|
||||
{
|
||||
$this->setProductId($parentId);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image parent id
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user