midcom_helper_datamanager_datatype_accountThe DATATYPE concept is the main interface between the data stored at a Midgard Object, the Widget that displays the Data and the Datamanger core class.
It does:
A important point is that this is a base class for a class hierarchy of datatypes. To make creating child classes a littlebit easier and less error_prone, the classes constructor has been moved to the method _constructor, which can be overwritten by clients. The advantage of this is that you can just call parent:: on this and don't need to remeber the name of the parent class to call its constructor. As PHP automatically uses the parent classes constructor if non is defined, it is enough to define the _constructor method in the subclasses.
See also this PHP Manual Note:
If you have a complex class hierarchy, I find that it's a good idea to have a function constructor() in every class, and the 'real' php constructor only exists in the absolute base class. From the basic constructor, you call $this->constructor(). Now descendants simply have to call parent::constructor() in their own constructor, which eliminates complicated parent calls.
The default behavoir implemented in this class is sufficiant for data with a text-representation. The derived datatype TEXT is more or less exactly this class, apart from some additional defaults.
Note, that since the introduction of the create method, all datatypes must be able to be initialized without a storage object, leading in an empty value and (in turn) an empty form element. The viewport must not neccesserily be operational, but the form interface must.
Datatype configuration
The basic datatype requires at least two configuration options:
location referrs to the storage location of the data. This can be either a valid member field of the storage object (e.g. "abstract"), "parameter" or "attachment". The latter two will define the name of the parameter or attachment automatically you just tell the Type to store itself in a parameter, that's it. Note, that parameters are limited to 255 characters in length, as are many of the regular Midgard object members.
widget defines the Widget to use for displaying the content of the type. You need to specify only the actual name of the widget, not the complete class name (e.g. "text" instead of "midcom_helper_datamanager_widget_text" or something like that).
Datatypes authors are strongly encouraged to define defaults for both of these configuration parameters, so that trival configurations can be made easily. The default storage location should be either a parameter or an attachment, as this is the only way to ensure multiple definitions of the same type will work out of the box.
Located in /midcom/helper/datamanager/datatype_account.php (line 3)
midcom_helper_datamanager_datatype | --midcom_helper_datamanager_datatype_account
midcom_helper_datamanager_datatype_account
midcom_helper_datamanager_datatype_account
(mixed &$datamanager, mixed &$storage, mixed $field)
mixed
$_enable_crypt
(line 6)
mixed
$_password
(line 8)
mixed
$_password_was_empty
(line 10)
mixed
$_username
(line 7)
mixed
$_verify_password
(line 9)
Inherited from midcom_helper_datamanager_datatype
midcom_helper_datamanager_datatype::$_datamanager
midcom_helper_datamanager_datatype::$_field
midcom_helper_datamanager_datatype::$_storage
midcom_helper_datamanager_datatype::$_value
midcom_helper_datamanager_datatype::$_widget
Inherited From midcom_helper_datamanager_datatype
midcom_helper_datamanager_datatype::midcom_helper_datamanager_datatype()
midcom_helper_datamanager_datatype::destroy()
midcom_helper_datamanager_datatype::get_csv_data()
midcom_helper_datamanager_datatype::get_value()
midcom_helper_datamanager_datatype::get_widget()
midcom_helper_datamanager_datatype::is_empty()
midcom_helper_datamanager_datatype::load_from_storage()
midcom_helper_datamanager_datatype::save_to_storage()
midcom_helper_datamanager_datatype::sync_data_with_widget()
midcom_helper_datamanager_datatype::sync_widget_with_data()
midcom_helper_datamanager_datatype::validate()
midcom_helper_datamanager_datatype::_constructor()
midcom_helper_datamanager_datatype::_datamanager_set_storage()
midcom_helper_datamanager_datatype::_get_default_value()
midcom_helper_datamanager_datatype::_get_empty_value()
midcom_helper_datamanager_datatype::_get_widget_default_value()
Documentation generated on Mon, 21 Nov 2005 18:14:01 +0100 by phpDocumentor 1.3.0RC3