[-] Classes : all classes and controllers now use their name in static calls instead of self (improve override) #PSFV-376
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12552 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -168,9 +168,9 @@ class StockAvailableCore extends ObjectModel
|
||||
// In case there are no warehouses, removes product from StockAvailable
|
||||
if (count($ids_warehouse) == 0)
|
||||
{
|
||||
self::removeProductFromStockAvailable($id_product);
|
||||
StockAvailable::removeProductFromStockAvailable($id_product);
|
||||
foreach ($ids_product_attribute as $id_product_attribute)
|
||||
self::removeProductFromStockAvailable($id_product, $id_product_attribute);
|
||||
StockAvailable::removeProductFromStockAvailable($id_product, $id_product_attribute);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,20 +281,20 @@ class SupplyOrderDetailCore extends ObjectModel
|
||||
foreach ($fields_required as $field)
|
||||
if (($value = $this->{$field}) == false && (string)$value != '0')
|
||||
if (!$this->id || $field != 'passwd')
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities)
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName($field, get_class($this), $htmlentities)
|
||||
.'</b> '.Tools::displayError('is required.');
|
||||
|
||||
/* Checks maximum fields sizes */
|
||||
foreach ($this->fieldsSize as $field => $max_length)
|
||||
if ($value = $this->{$field} && Tools::strlen($value) > $max_length)
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities)
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName($field, get_class($this), $htmlentities)
|
||||
.'</b> '.Tools::displayError('is too long.').' ('.Tools::displayError('Maximum length:').' '.$max_length.')';
|
||||
|
||||
/* Checks fields validity */
|
||||
foreach ($this->fieldsValidate as $field => $function)
|
||||
if ($value = $this->{$field})
|
||||
if (!Validate::$function($value) && (!empty($value) || in_array($field, $this->fieldsRequired)))
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||
else
|
||||
if ($field == 'passwd')
|
||||
if ($value = Tools::getValue($field))
|
||||
@@ -303,13 +303,13 @@ class SupplyOrderDetailCore extends ObjectModel
|
||||
$this->{$field} = $value;
|
||||
|
||||
if ($this->quantity_expected <= 0)
|
||||
$errors[] = '<b>'.self::displayFieldName('quantity_expected', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName('quantity_expected', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
|
||||
if ($this->tax_rate < 0 || $this->tax_rate > 100)
|
||||
$errors[] = '<b>'.self::displayFieldName('tax_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName('tax_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
|
||||
if ($this->discount_rate < 0 || $this->discount_rate > 100)
|
||||
$errors[] = '<b>'.self::displayFieldName('discount_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
$errors[] = '<b>'.SupplyOrderDetail::displayFieldName('discount_rate', get_class($this)).'</b> '.Tools::displayError('is invalid.');
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ class WarehouseCore extends ObjectModel
|
||||
// if it's a pack, returns warehouses if and only if some products use the advanced stock management
|
||||
if (Pack::isPack($id_product))
|
||||
{
|
||||
$warehouses = self::getPackWarehouses($id_product);
|
||||
$warehouses = Warehouse::getPackWarehouses($id_product);
|
||||
$res = array();
|
||||
foreach ($warehouses as $warehouse)
|
||||
$res[]['id_warehouse'] = $warehouse;
|
||||
|
||||
Reference in New Issue
Block a user