Added Service Add, some internal consistency updates

This commit is contained in:
Deon George
2013-11-27 11:22:20 +11:00
parent c18d5a3881
commit 0ed5e5163d
29 changed files with 372 additions and 179 deletions

View File

@@ -35,6 +35,8 @@ class Model_Product extends ORM_OSB {
),
);
protected $_form = array('id'=>'id','value'=>'description()');
protected $_nullifempty = array(
'price_group',
);
@@ -107,6 +109,13 @@ class Model_Product extends ORM_OSB {
return ORM::factory(Kohana::classname(sprintf('Product_Plugin_%s',$this->prod_plugin_file)),$this->prod_plugin_data);
}
/**
* Enable the plugin to store data during an update
*/
public function plugin_edit() {
return (is_null($x = $this->plugin())) ? NULL : $x->render_edit();
}
public function save(Validation $validation=NULL) {
parent::save($validation);
@@ -187,16 +196,6 @@ class Model_Product extends ORM_OSB {
return $price ? $price : array('0'=>array('price_base'=>0,'price_setup'=>0));
}
/**
* Enable the plugin to store data
*/
public function admin_update() {
if (is_null($plugin = $this->plugin()))
return NULL;
else
return $plugin->admin_update();
}
/**
* Return the configured price groups for this product
*/