mysql_map_class

mysql_map_class — maps fields and data onto an existing Gamma class.

Syntax

mysql_map_class(class, fields, data)
    

Arguments

class

An existing Gamma class.

fields

A one-dimensional array of field names that will be used to create instance variables in the class.

data

A two-dimensional array of data as returned by MYSQL_RES.Data.

Returns

A one-dimensional array of instances of class class, where the values of the instance variables named in fields have the values provided in data. The instances in the return array correspond to the rows in data, and are arranged in the same order as the first dimension of the data array.

Description

This function maps the fields and data onto an existing Gamma class, and then constructs a set of instances of that class, one per row in the data. The names of the class instance variables will be the elements of the fields array.

[Note]

This is a built-in Gamma function that is similar to but does not exactly match the MySQL function mysql_map_class.