Formatting output Plese Wait...
zDynOrm Class Reference
[Dynamic ORM]
|
Public Member Functions |
| zDynOrm ($connAlias, $tableName) |
| __construct ($connAlias, $tableName) |
| Constructs Table level Objects.
|
Private Member Functions |
| colList ($conAlias, $driver) |
| Bind's Proper driver, and connects through it.
|
Detailed Description
builds a table Object dynamically. without using static ORM Maps. it uses the real column names as the column alias name. and as there is no orm map assiciated wit it it doesn't uses any
validation filters. you need to load dynOrm module to use it.
You can use any magic method that comes from
zOrm_magic and its parents like
findCol() or findColByOp() etc.. You can also use non-magic methods from zOrm_nomagic Class as
zOrm_magic inherits from zOrm_nomagic Class.
you need to pass a table name with which you want to connect and pass the connection name e.g. Connection file name by using that it will connect.
you can even create dynamic Connection files on the fly. take a look at the
zCDE Class/Module. If you dont need magic-method support use
zDbAccess Class Instead.
Show Source $this->load->module('dynOrm');
$stdObj = new zDynOrm('conAliasName', 'student');
$stdObj->findName();
Definition at line 64 of file dynorm.php.
Constructor & Destructor Documentation
zDynOrm::__construct( string $connAlias, string $tableName )
Constructs Table level Objects.
- Parameters:
-
| $connAlias | Connection file name |
| $tableName | Table name to which to connect. |
Definition at line 74 of file dynorm.php.
References zOrm_core::$connAlias, colList(), zOrm_core::init(), and perror().
Show Source00074 {
00075 $path = ZIGROOT.DRS.Z_DIR_PROJECTS.DRS.Z_PROJECT_DIR.DRS.ZIGSETTINGSDIR.DRS.Z_DIR_ETC_CONF.DRS.$connAlias.".con.ini.php";
00076 if(!file_exists($path)){
00077 perror('<code>zigmoyd.dynamicOrm.init</code><br />Failed to parse the connection file '.$connAlias.' as the file doesn\'t exist');
00078 exit;
00079 }
00080 if(!defined('ZIGORM_Q_SELECT')){define('ZIGORM_Q_SELECT', 's');}
00081 if(!defined('ZIGORM_Q_INSERT')){define('ZIGORM_Q_INSERT', 'i');}
00082 if(!defined('ZIGORM_Q_UPDATE')){define('ZIGORM_Q_UPDATE', 'u');}
00083 if(!defined('ZIGORM_Q_REMOVE')){define('ZIGORM_Q_REMOVE', 'r');}
00084 if(!defined('ZIGORM_Q_SQL')){define('ZIGORM_Q_SQL', 'q');}
00085 if(!defined('ZIGORM_Q_TRUNCATE')){define('ZIGORM_Q_TRUNCATE', 't');}
00086 if(!defined('ZIGORM_NO_FLUSH')){define('ZIGORM_NO_FLUSH', false);}
00087 if(!defined('ZIGORM_FLUSH')){define('ZIGORM_FLUSH', true);}
00088 if(!defined('ZIGORM_NO_QUOTE'))define('ZIGORM_NO_QUOTE', false);
00089 if(!defined('ZIGORM_QUOTE'))define('ZIGORM_QUOTE', true);
00090 if(!defined('ZIGORM_Q_JOIN')){define('ZIGORM_Q_JOIN', 'j');}
00091 if(!defined('ZIGORM_Q_AUTOJOIN')){define('ZIGORM_Q_AUTOJOIN', 'aj');}
00092 if(!defined('ZIGORM_JOIN_CROSS'))define('ZIGORM_JOIN_CROSS', 'jc');
00093 if(!defined('ZIGORM_JOIN_LEFT'))define('ZIGORM_JOIN_LEFT', 'jl');
00094 if(!defined('ZIGORM_JOIN_RIGHT'))define('ZIGORM_JOIN_RIGHT', 'jr');
00095 if(!defined('ZIGORM_JOIN_FULL'))define('ZIGORM_JOIN_FULL', 'jf');
00096 if(!defined('ZIGORM_JOIN_INNER'))define('ZIGORM_JOIN_INNER', 'ji');
00097 if(!defined('ZIGORM_JOIN_NATURAL'))define('ZIGORM_JOIN_NATURAL', 'jn');
00098 if(!defined('ZIGORM_OP_EQUALS'))define('ZIGORM_OP_EQUALS', '=');
00099 if(!defined('ZIGORM_OP_GREATER'))define('ZIGORM_OP_GREATER', '>');
00100 if(!defined('ZIGORM_OP_LESS'))define('ZIGORM_OP_LESS', '<');
00101 if(!defined('ZIGORM_OP_GREATER_EQUALS'))define('ZIGORM_OP_GREATER_EQUALS', '>=');
00102 if(!defined('ZIGORM_OP_LESS_EQUALS'))define('ZIGORM_OP_LESS_EQUALS', '<=');
00103 if(!defined('ZIGORM_OP_NOT_EQUALS'))define('ZIGORM_OP_NOT_EQUALS', '<>');
00104 $conData = parse_ini_file($path);
00105 $this->realTableName = $tableName;
00106 $this->tableAlias = $tableName;
00107 $this->connAlias = $connAlias;
00108 $this->__struct = new stdClass();
00109 $this->__struct->alias = $tableName;
00110 $this->__struct->Attributes = array();
00111 foreach($this->colList($connAlias, $conData['driver']) as $colName){
00112 $this->__struct->Attributes[$colName] = new stdClass();
00113 $this->__struct->Attributes[$colName]->alias = $colName;
00114 $this->__struct->Attributes[$colName]->permission = 'writable';
00115 }
00116 if(function_exists('overload'))overload(get_class($this));
00117 $this->init();
00118 }
Top
Member Function Documentation
zDynOrm::zDynOrm( string $connAlias, string $tableName )
zDynOrm::colList( string $conAlias, string $driver ) [private]
The documentation for this class was generated from the following file: