439
edits
| Line 101: | Line 101: | ||
== CustomFields JSON API == | == CustomFields JSON API == | ||
=== Storing extra options === | |||
You can use the '''setExtra()''' method to set extra options of a custom field. | |||
Eg: | |||
<source lang="php"> | |||
$extra = new stdClass(); // instanciating an empty object | |||
$extra->myproperty = 'Anything I want here'; // set a property/extra option like this | |||
$extra->category->subcategory->prop = true; // we can set recursive properties, there's not any limit to own deep the hierarchy can be | |||
require_once(dirname(__FILE__).'/../class/customfields.class.php'); | |||
$fieldid = 'mycustomfields'; // $fieldid can either be a column_name or an ordinal_position from information_schema.columns | |||
$result = $customfields->setExtra($fieldid, $extra); // store the extra options inside the database | |||
</source> | |||
= Architecture = | = Architecture = | ||
edits