Loading Please wait...

Common Database Essentials
[Database ConnectivityCommon Utilities required by Zigmoyd.]

Collaboration diagram for Common Database Essentials:
This file is part of Zigmoyd PHP Framework. More...

Data Structures

class  zCDE

Detailed Description

This file is part of Zigmoyd PHP Framework.

Copyright (C) 2008 Neel Basu (Sunanda Bose)

Zigmoyd PHP Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Zigmoyd PHP Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Zigmoyd PHP Framework. If not, see <http://www.gnu.org/licenses/>.

Highly Important while accessing database.When you are using find+ methods e.g. findCol() etc. it returns the data or the row as a scaler value if only one row returned. suppose you have a table called student where you invoke findName() method which you expect will return an array of string(names) But will return only one string if there is only one value available.

 +---------+
 |  Name   |
 +---------+
 |   Foo   |
 +---------+
 
However if there is more than one value aviliable it will return an array. so if you do
 $studentVect = $this->db->Student->findName();
 foreach($studentVect as $i => $name){
  //Some Code Here
 }
The above Code will fire an error if there is only one row/name found in your table cause $studentVect will not be an array then. rather it wil be a string. so you need to make that uniterable string iterable by using zCDE::toIterable($studentVect)
 $studentVect = $this->db->Student->findName();
 foreach(zCDE::toIterable($studentVect) as $i => $name){
  //Some Code Here
 }
toIterable will make it iterable if its not.You can similerly use toUnIterable when you expect Scaler value

Sometime you might require to create Connection File on the fly you can also do that using the methods like createConn(), overWriteConn() etc.. You can also parse a connection file.
You need to load the zCDE Module to use its functionality. $this->load->module('zCDE')

Generated on Mon Oct 27 23:52:56 2008 for zigmoyd.kdevelop by doxygen 1.5.6