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/Module.php

43 lines
1.1 KiB
PHP
Raw Normal View History

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports OSB exporting.
*
* @package Export
2013-05-28 11:35:54 +00:00
* @category Models
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Export_Module extends ORM_OSB {
protected $_created_column = FALSE;
protected $_updated_column = FALSE;
// Relationships
protected $_belongs_to = array(
'export' => array(),
'module' => array(),
);
protected $_has_many = array(
'export_item' => array('far_key'=>'id'),
);
protected $_nullifempty = array(
'display',
);
public function list_export() {
$o = $this->module->module();
return $o
->select(array($this->export_item->table_name().'.date_orig','exported'))
->join($this->export_item->table_name(),'LEFT OUTER')
->on($this->export_item->table_name().'.site_id','=',$o->table_name().'.site_id') // @todo This should be automatic
->on($this->export_item->table_name().'.item_id','=',$o->table_name().'.id')
->on('export_module_id','=',$this->id)
->where($o->table_name().'.date_orig','>=',time()-86400*90)
->find_all();
}
}
?>