/** * Dynamic Get Function Override * * @param $name * A string containing the name of the property to get. * @return * Value of the property. */ public function __get($propertyName) { global $firePHP; if ($propertyName == 'columns') { if (!isset($this->_columns)) { //---- Get Columns $this->_columns = new anvilCollection(); $i = 0; $totalColumns = count($this->array[0]); $keys = array_keys($this->array[0]); for ($i = 0; $i < $totalColumns; $i++) { $newColumn = new anvilData_array_Column($keys[$i]); $this->_columns->add($newColumn); } } return $this->_columns; } else { return parent::__get($propertyName); } }
/** * Dynamic Get Function Override * * @param $name * A string containing the name of the property to get. * @return * Value of the property. */ public function __get($propertyName) { // global $firePHP; if ($propertyName == 'columns') { if (!isset($this->_columns)) { //---- Get Columns $this->_columns = new anvilCollection(); $i = 0; // $sql = 'SHOW COLUMNS FROM '; while ($i < mysql_num_fields($this->result)) { $meta = mysql_fetch_field($this->result, $i); if ($meta) { // $firePHP->_log($meta); $newColumn = new anvilData_mysql_Column($meta->name, $meta->type); $this->_columns->add($newColumn); } $i++; } } return $this->_columns; } else { return parent::__get($propertyName); } }