00001 <?php
00031 class OrmDriver{
00036 var $conn;
00041 var $connAlias=null;
00046 var $connData;
00050 var $res;
00055 var $sql;
00060 var $qType;
00064 var $afectedRows;
00068 var $numRows;
00073 var $connected;
00078 var $lex;
00083 var $caller;
00084
00090 function connAlias($conAliasName=null){
00091 if(is_null($conAliasName))return $this->connAlias;
00092 $path = ZIGROOT.DRS.Z_DIR_PROJECTS.DRS.Z_PROJECT_DIR.DRS.ZIGSETTINGSDIR.DRS.Z_DIR_ETC_CONF.DRS.$conAliasName.".con.ini.php";
00093
00094 if(!file_exists($path)){
00095 print("<code>zigmoyd.orm.driver.core.connection</code>No such Connection file exists on ".$path);
00096 return false;
00097 }
00098 if(!is_readable($path)){
00099 perror("<code>zigmoyd.orm.driver.core.connection</code>Connection file exists on ".$path." but not readable Plese check the permission");
00100 return false;
00101 }
00102 $this->connData = parse_ini_file($path);
00103 $this->connAlias = $conAliasName;
00104 return false;
00105 }
00110 function qType($qType){
00111 $this->qType = $qType;
00112 }
00118 function pasteLex($lex){
00119 $this->lex = $lex;
00120 }
00125 function isConnected(){
00126 return $this->connected;
00127 }
00132 function numRows(){
00133 return $this->numRows;
00134 }
00139 function affectedRows(){
00140 return $this->afectedRows;
00141 }
00148 function whereLexToStr($whereLex){
00149 $whereStr = '';
00150 $lineStr = array();
00151 foreach($whereLex as $whereObj){
00152 $value = ($whereObj->quote) ? "'$whereObj->value'" : $whereObj->value;
00153 $cnj = (count($lineStr) >= 1) ? $whereObj->cnj : "";
00154 $lineStr[] = trim("$cnj $whereObj->colName $whereObj->op $value");
00155 }
00156 return implode(" ", $lineStr);
00157 }
00162 function setCaller(&$caller){
00163 $this->caller = $caller;
00164 }
00165
00166 function connect(){
00167 perror("<code>zigmoyd.orm.driver.core.connect()</code>The Driver Class Must override the connect() Method");
00168 }
00169 function disConnect(){
00170 perror("<code>zigmoyd.orm.driver.core.connect()</code>The Driver Class Must override the disConnect() Method");
00171 }
00172 function execute(){
00173 perror("<code>zigmoyd.orm.driver.core.connect()</code>The Driver Class Must override the execute() Method");
00174 }
00175 function exportRaw(){
00176 perror("<code>zigmoyd.orm.driver.core.connect()</code>The Driver Class Must override the exportRaw() Method");
00177 }
00178
00179 }
00181 ?>