Inspecting and Manipulating Object State

$obj->column_values()

Use column_values and set_values to get and set the fields of an object en masse. The former returns a hash reference mapping column names to their values in this object. For example:

$values = $obj->column_values()

$obj->set_values()

set_values accepts a similar hash ref, which need not give a value for every field. For example:

$obj->set_values({col1 => $val1, col2 => $val2});

is equivalent to

$obj->col1($val1);
$obj->col2($val2);

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.