// BO refactoring

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12620 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2012-01-23 16:57:11 +00:00
parent 658a9af766
commit 3dbef1187d
2 changed files with 37 additions and 31 deletions
+5 -2
View File
@@ -610,7 +610,10 @@ class AdminControllerCore extends Controller
public function processSave($token)
{
if ($this->id_object)
{
$this->object = $this->loadObject();
return $this->processUpdate($token);
}
else
return $this->processAdd($token);
}
@@ -673,7 +676,7 @@ class AdminControllerCore extends Controller
/* Checking fields validity */
$this->validateRules();
if (count($this->errors) <= 0)
if (empty($this->errors))
{
$id = (int)Tools::getValue($this->identifier);
@@ -745,7 +748,7 @@ class AdminControllerCore extends Controller
}
}
$this->errors = array_unique($this->errors);
if (count($this->errors) > 0)
if (!empty($this->errors))
return;
if (isset($object))
return $object;