Major work to domain and hosting
Minor updates for ADSL services Updates to Sort::MAsort() Move core OSB items under application/ Moved ACCOUNT functions under application Minor updates to task
This commit is contained in:
@@ -14,6 +14,7 @@ class Model_Product extends ORMOSB {
|
||||
// @todo this doesnt have our site_id when getting the translation
|
||||
protected $_has_many = array(
|
||||
'product_translate'=>array('far_key'=>'id'),
|
||||
'service'=>array('far_key'=>'id'),
|
||||
);
|
||||
|
||||
protected $_sorting = array(
|
||||
@@ -27,21 +28,6 @@ class Model_Product extends ORMOSB {
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* The feature summary should be implemented in child objects.
|
||||
* It is displayed on the product overview page, as a summary of the products features.
|
||||
*/
|
||||
protected function _feature_summary() {
|
||||
throw new Kohana_Exception(':method not defined in child class :class',array(':method'=>__METHOD__,':class'=>get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* The summary should be implemented in child objects.
|
||||
*/
|
||||
protected function _summary() {
|
||||
return _('No Description');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the object of the product plugin
|
||||
*/
|
||||
@@ -52,8 +38,7 @@ class Model_Product extends ORMOSB {
|
||||
if (! is_numeric($this->prod_plugin_data))
|
||||
throw new Kohana_Exception('Missing plugin_id for :product (:type)',array(':product'=>$this->id,':type'=>$this->prod_plugin_file));
|
||||
|
||||
$spn = sprintf('%s_%s',get_class($this),$this->prod_plugin_file);
|
||||
return new $spn($this->prod_plugin_data);
|
||||
return ORM::factory(sprintf('product_plugin_%s',$this->prod_plugin_file),$this->prod_plugin_data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,36 +52,7 @@ class Model_Product extends ORMOSB {
|
||||
* This will render the product feature summary information
|
||||
*/
|
||||
public function feature_summary() {
|
||||
if (is_null($plugin = $this->plugin()))
|
||||
return HTML::nbsp('');
|
||||
else
|
||||
return $plugin->_feature_summary();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the summary description
|
||||
*
|
||||
* Generally this is used on the invoice summary page
|
||||
*/
|
||||
public function summary() {
|
||||
if (is_null($plugin = $this->plugin()))
|
||||
return _('Other');
|
||||
else
|
||||
return $plugin->_summary();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the products for a given category
|
||||
* @todo This shouldnt be here.
|
||||
*/
|
||||
public function category($cat) {
|
||||
$results = array();
|
||||
foreach ($this->where('active','=',TRUE)->find_all() as $po) {
|
||||
if ($c = unserialize($po->avail_category_id) AND in_array($cat,$c))
|
||||
array_push($results,$po);
|
||||
}
|
||||
|
||||
return $results;
|
||||
return (is_null($plugin = $this->plugin())) ? HTML::nbsp('') : $plugin->feature_summary();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,5 +111,20 @@ class Model_Product extends ORMOSB {
|
||||
// @todo Change the ALT to the product name.
|
||||
echo HTML::image($thumb,array('alt'=>_('Thumb Nail')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the products for a given category
|
||||
* @todo This shouldnt be here.
|
||||
*/
|
||||
public function list_category($cat) {
|
||||
$results = array();
|
||||
|
||||
foreach ($this->where('active','=',TRUE)->find_all() as $po) {
|
||||
if ($c = unserialize($po->avail_category_id) AND in_array($cat,$c))
|
||||
array_push($results,$po);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user