// AdminController: added beforeAdd() method
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10744 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -620,6 +620,7 @@ class AdminControllerCore extends Controller
|
|||||||
{
|
{
|
||||||
$object = new $this->className();
|
$object = new $this->className();
|
||||||
$this->copyFromPost($object, $this->table);
|
$this->copyFromPost($object, $this->table);
|
||||||
|
$this->beforeAdd($object);
|
||||||
if (!$object->add())
|
if (!$object->add())
|
||||||
{
|
{
|
||||||
$this->_errors[] = Tools::displayError('An error occurred while creating object.').
|
$this->_errors[] = Tools::displayError('An error occurred while creating object.').
|
||||||
@@ -2533,5 +2534,16 @@ EOF;
|
|||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called before Add
|
||||||
|
*
|
||||||
|
* @param object $object Object
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
protected function beforeAdd($object)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user