Working : Image management set on Category

This commit is contained in:
gmorel
2013-09-22 20:50:42 +02:00
parent cf7e6d6952
commit b91a11536b
31 changed files with 3620 additions and 510 deletions

View File

@@ -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;
}
/**

View File

@@ -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
*

View File

@@ -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
*

View File

@@ -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
*