->setFrom() | ->validate() |
DB_DataObject | |
PEAR Manual | |
array $DB_DataObject->toArray (
string $format = '%s'
,
bool $hideEmpty = FALSE
)
Allows the fetching of an associate array (with optional key formating) for use with other packages, like HTML_QuickForm.
From PHP4.2.3RC2 onwards, The values of each column are retrieved using getXXXX() methods so you can change the formating of a row by defining a getter method.
string $format - a sprintf string eg. 'form[%s]'
bool $hideEmpty - If set to true, empty elements (no value/null) will not be returned
This function can not be called statically.
getting arrays
|
Sample Output
Array ( [id] => 2 [name] => test [username] => username [password] => [firstname] => jones [lastname] => ) Array ( [user[id]] => 2 [user[name]] => test [user[username]] => username [user[password]] => [user[firstname]] => jones [user[lastname]] => ) Array ( [user[id]] => 2 [user[name]] => test [user[username]] => username [user[firstname]] => jones ) |
->setFrom() | ->validate() |
DB_DataObject | |
PEAR Manual | |