Setting and retrieving column values

To set the column value of an object, use the name of the column as a method name, and pass in the value for the column:

$foo->foo('bar');

The return value of the above call will be bar, the value to which you have set the column.

To retrieve the existing value of a column, call the same method, but without an argument:

$foo->foo

This returns the value of the foo column from the $foo object.

$obj->init()

This method is used to initialize the object upon construction.

$obj->set_defaults()

This method is used by the init method to set the object defaults.

This page is part of the MT::Object Reference

This page was last updated on 2008-10-01, 17:07.

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.