![]() |
Data Structures | |
class | zCDE |
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 }
zCDE::toIterable($studentVect)
$studentVect = $this->db->Student->findName(); foreach(zCDE::toIterable($studentVect) as $i => $name){ //Some Code Here }
$this->load->module('zCDE')