This class controls all type I/O operations, including entering and exiting editing operations and creation support. It brings Types, Schemas and Storage objects together.
| package | midcom.helper.datamanager2 |
|---|
| see | \midcom_helper_datamanager2_schema::load_database() |
|---|
array&$schemadb A list of midcom_helper_datamanager2_schema instances,
indexed by their schema name. This member is taken by reference.stringfield namebooleanindicating b0rkednessThe schema name is looked up in the parameter 'midcom.helper.datamanager2/schema_name', if it is not found, the first schema from the schema database is used implicitly.
| see | \set_schema() |
|---|---|
| see | \set_storage() |
mixed&$object A reference to either a MidCOM DBA class or a subclass of
midcom_helper_datamanager2_storage.booleanWhether we should strictly use only the schema given by object paramsbooleanIndicating success.Be aware that this is only geared for simple administration interfaces, it will provide no editing capabilities (like AJAX) etc. If you want that to work, you need a formmanger instance instead.
booleanShould empty fields be rendered or notArrayAll field values in their CSV representation indexed by their name.ArrayAll field values in their CSV representation indexed by their name.ArrayAll field values in their HTML representation indexed by their name..
ArrayAll field values in their raw storage representation indexed by their name.ArrayAll field values in their XML representation indexed by their name.This can be used for regenerating all images or converted files of a given object when for instance schema changes.
booleanA full validation cycle is done beforehand, if any validation fails, the function aborts and sets the $validation_errors member variable accordingly.
booleanIndicating successThis will drop all existing types and create a new set of them which are in the default state at this point.
This will reset the existing schema and type listing. If a storage object exists, the change of the schema will be propagated implicitly, as it will reference the schema member of ours.
stringThe name of the schema to use, omit this to use the default
schema.booleanIndicating success.You can pass either a MidCOM DBA object or a fully initialized storage subclass. The former is automatically wrapped in a midcom storage object. If you pass your own storage object, ensure that it uses the same schema as this class. Ideally, you should use references for this.
This call will fail if there is no schema set. All types will be set and initialized to the new storage object. Thus, it is possible to call set_storage repeatedly thus switching an existing DM instance over to a new storage object as long as you work with the same schema.
mixed&$object A reference to either a MidCOM DBA class or a subclass of
midcom_helper_datamanager2_storage.booleanIndicating success.It will populate $validation_errors accordingly.
booleanIndicating validation success.It will load class files where necessary (using require_once), and then create a set of instances based on the schema.
booleanIndicating successUsually, it is created and referenced here by the controller class during initialization.
This object can be modified as long as the types are not initialized. If you change the schema afterwards, the changes will not propagate to any dependant object until you reinitialize the class.
It encapsulates the storage target.
You may manipulate these types and their values at will, and then store them back to the database using the functions available in this class.
As outlined in the type, these messages my have inline-html in it and it is assumed to be localized.
The errors are indexed by field name.
| see | \midcom_helper_datamanager2_type::$validation_error |
|---|
This variable will always contain a parsed representation of the schema, so that one can swiftly switch between individual schemas of the Database. This is a list of midcom_helper_datamanager2_schema instances, indexed by their name.