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/modules/export/classes/Model/Export.php

35 lines
792 B
PHP
Raw Normal View History

2013-10-10 02:44:53 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports OSB exporting.
2013-10-10 02:44:53 +00:00
*
* @package Export
2013-05-28 11:35:54 +00:00
* @category Models
2013-10-10 02:44:53 +00:00
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Export extends ORM_OSB {
// Relationships
protected $_has_many = array(
'export_module' => array('far_key'=>'id','xforeign_key'=>'x'),
2013-10-10 02:44:53 +00:00
);
protected $_form = array('id'=>'id','value'=>'name');
2013-10-10 02:44:53 +00:00
/**
2013-05-27 12:10:41 +00:00
* Return the object of the export plugin
*/
public function plugin(Model_Export_Module $emo,$type='') {
$c = Kohana::classname('Export_Plugin_'.$this->plugin);
2013-10-10 02:44:53 +00:00
if (! $this->plugin OR ! class_exists($c))
return NULL;
2013-10-10 02:44:53 +00:00
$o = new $c($emo);
return $type ? $o->$type : $o;
2013-10-10 02:44:53 +00:00
}
}
?>