[*] Classes: calcul position in class when an attribute, an image or a scene is added
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9638 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -94,6 +94,14 @@ class ImageCore extends ObjectModel
|
||||
return $this->getTranslationsFields(array('legend'));
|
||||
}
|
||||
|
||||
public function add($autodate = true, $null_values = false)
|
||||
{
|
||||
if ($this->position <= 0)
|
||||
$this->position = Image::getHighestPosition($this->id_product) + 1;
|
||||
|
||||
return parent::add($autodate, $null_values);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
if (!parent::delete() ||
|
||||
|
||||
Reference in New Issue
Block a user