[WORKING] mosBindArrayToObject

Last reviewed: Not reviewed


Copy the contents of an array into an object.

This function matches fields in the array with attributes of the same name in the object. If a field exists in the array but does not match an attribute in the object then it is ignored. If an attribute exists in the object but does not match an array field then it will be ignored. Object attributes whose name begins with an underscore character are always ignored.

Returns true if successful; false otherwise.


boolean mosBindObjectToArray ( array $array, object $obj [, string $ignore [, string $prefix
                                                                         [, boolean $stripSlashes ]]] )

is an associative array of key/value pairs to update.
is the object to be updated.
is a string. If a key name contains this string as a substring then the key/value pair will be ignored. This argument is optional and if omitted will default to an emtpy string.
is a prefix string. An array entry will bind to an object attribute only if the field name with the prefix string prepended to it also exists. This parameter is optional and if omitted will default to null.
is a flag. If true and magic_quotes_gpc is also true then slashes will be removed from the updated value placed in the object. If false or if magic_quotes_gpc is false then slashes will not be removed.  This parameter is optional and if omitted will default to true.

Defined in

(includes/joomla.php prior to Joomla 1.1)
(includes/mambo.php prior to Joomla 1.0)



Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )