opencart/opencart — pull request #1531 by mhcwebdesign (2014-06-01 19:21:28+00:00)
Title: Make model classes more extension friendly

Most model classes could be made more class extension friendly, by slightly changing their addXXX methods.

For example, if an extension uses an extends class ModelCatalogProduct, because it wants to add support for additional DB fields, it could easily overwrite method addProduct and use something like this:

```
// overridden method
public function addProduct( $data ) {
$product_id = parent::addProduct( $data );
$this->db->query( "UPDATE `".DB_PREFIX."product` SET new_field='".$this->db->escape($data['new_field'])."' WHERE product_id = '".(int)$product_id."'" );
return $product_id;
}
```