This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/Model/Module/Method.php
Deon George 04ebda2aaa Theme work with focusbusiness and baseadmin
Improvements to NAVBAR, updates to StaticList methods, other minor items
Enable product category rendering and other minor improvements
Added ADSL-large category price plan
2013-10-10 13:56:13 +11:00

53 lines
1.3 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB Application Module Method Model
*
* @package OSB
* @category Models
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Module_Method extends ORM_OSB {
// This module doesnt keep track of column updates automatically
protected $_created_column = FALSE;
protected $_updated_column = FALSE;
// Relationships
protected $_belongs_to = array(
'module'=>array(),
);
protected $_has_one = array(
'record_id'=>array(),
);
protected $_has_many = array(
'group'=>array('through'=>'group_method','foreign_key'=>'method_id')
);
protected $_sorting = array(
'name'=>'ASC',
);
/**
* Calculate the description for this method on any menu link
*/
public function menu_display() {
// @todo The test for value equal 1 is for legacy, remove when all updated.
if ($this->menu_display AND $this->menu_display != 1)
return $this->menu_display;
else
return sprintf('%s: %s',$this->module->name,$this->name);
}
public function url() {
if (! preg_match('/_/',$this->name))
return NULL;
list($type,$action) = preg_split('/_/',$this->name,2);
return URL::link($type,$this->module->name.'/'.$action);
}
}
?>