More WIP
This commit is contained in:
parent
83c6429c4c
commit
9edf5b81b3
37
classes/ORM/DB2.php
Normal file
37
classes/ORM/DB2.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class extends Kohana's [ORM] class to create defaults for DB2.
|
||||||
|
*
|
||||||
|
* @package Kohana/Database
|
||||||
|
* @category Models
|
||||||
|
* @author Deon George
|
||||||
|
* @copyright (c) 2010-2015 Deon George
|
||||||
|
* @license http://dev.leenooks.net/license.html
|
||||||
|
*/
|
||||||
|
abstract class ORM_DB2 extends ORM {
|
||||||
|
// Suppress ORMs inclusion of Table Aliass
|
||||||
|
protected $_disable_column_alias = TRUE;
|
||||||
|
// Suppress ORMs use of limit
|
||||||
|
protected $_disable_limit = TRUE;
|
||||||
|
|
||||||
|
protected $_table_names_plural = TRUE;
|
||||||
|
|
||||||
|
protected function _initialize() {
|
||||||
|
$this->_object_name = strtolower(substr(get_class($this), 6));
|
||||||
|
|
||||||
|
// Table name is the same as the object name in uppercase
|
||||||
|
$this->_table_name = $this->_object_name;
|
||||||
|
|
||||||
|
if ($this->_table_names_plural === TRUE)
|
||||||
|
{
|
||||||
|
// Make the table name plural
|
||||||
|
$this->_table_name = Inflector::plural($this->_object_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_table_name = strtoupper($this->_table_name);
|
||||||
|
|
||||||
|
parent::_initialize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Reference in New Issue
Block a user