Document toolboxDocument toolbox

Class SettingsProfile

The class \Microbizz\SettingsProfile handles collections of settings, known as "profiles". This was invented for the new route planning (a.k.a. "Directions"), where it is used to handle the parameters for the route finder.

Yon can have a collection of settings/profiles for each modcode.

The settings are defined in a .frm file in  obj/F/form/profile-MODCODE.frm.

Database

FieldTypeDescription
profile_id key
title string Profile title
owner_user_ref reference (User) Owner of the profile
allow_all bool If others should be allowed to access the profile
objecttype string The modcode or type of object this profile applies to
settings array The settings that make up the profile
metadata array
create_date date+time Created
change_date date+time Last change
is_deleted bool

Example

To allow a user to select/edit profiles, use the FProfile component:

  $profilefield = new FProfile(l('Profile'), 'profile_id', false, ['objecttype' => 'routing', 'width' => 160, 'setsaved' => true]);
  $form→addField($profilefield);

When the user has selected a profile, and the ID of the profile is used somewhere:

  $profile = new \Microbizz\SettingsProfile();
$profile->loadForRead($profile_id);
$profile = $profile→settings;

The FProfile component uses obj/F/php/profile-editor.php and obj/F/php/save-profile.php.