| File | Comments |
|---|---|
| class/fsmeta.php | |
| class/fsmeta_meta.php |
-
|
| class/fsmeta_factory.php |
-
|
| class/fsmeta_form.php |
-
|
| class/fsmeta_table.php |
-
|
| class/fsmeta_field.php |
-
|
| class/fsmeta_field_factory.php |
-
|
| class/fsmeta_choice.php |
-
|
| class/fsmeta_choice_factory.php |
-
|
| class/fsmeta_types.php |
-
|
| Class | Comments |
|---|---|
| fsMetaException | This is the exception-class used throughout the fsMeta system. |
| fsMeta | This is the main class used for reading, writing, rendering form inputs and parsing posted form input. (more...) |
| fsMetaFactory | This factory class can be used to query metadata, or as a helper to create JOIN statements in foreign factory classes. |
| XoopsFormMetaData | This XoopsFormElement can be used to render groups of metadata editors. (more...) |
| fsMetaTable | A table represents a single physical table containing metadata, and provides access to fields. (more...) |
| fsMetaField | Field-type determines the kind of type-handler class used to manage the field, refer to the fsMetaType classes for more information. (more...) |
| fsMetaFieldFactory |
-
|
| fsMetaChoice | This class implements a choice for a field (e.g. fields of type Select or Multi) (more...) |
| fsMetaChoiceFactory |
-
|
| fsMetaTypeHandler | This class provides utility functions related to field-type handlers. (more...) |
| fsMetaType | This abstract class defines abstract and default methods for all field-type handlers. |
| fsMetaType_String | This handler implements a simple string, stored in a VARCHAR(255) column |
| fsMetaType_Text | This handler implements a large string, stored in a TEXT column |
| fsMetaType_Int | This handler implements a signed integer number, stored in an INT column |
| fsMetaType_Time | This handler implements a date and time field, stored in a DATETIME column |
| fsMetaType_Select | This handler implements single selection from a collection of choices, stored as a single INT column. (more...) |
| fsMetaType_Multi | This class implements multiple selections from a collection of choices, stored as one TINYINT column per choice. (more...) |
This is the exception-class used throughout the fsMeta system.
| Member Methods | |||||||
| Method | Comments | ||||||
|---|---|---|---|---|---|---|---|
__construct
|
-
| ||||||
public __construct ( $message )
| |||||||
Use metadata accessor methods to get to the actual metadata.
Use the form input/output methods to easily render and parse form elements.
| Member Methods | ||||||||||||||||
| Method | Comments | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
~ fs Meta
| If the provided tablename does not exist, a table with that name is automatically created. (more...) | |||||||||||||||
public static fsMeta ( $tablename, $id )
If the provided tablename does not exist, a table with that name is automatically created. The constructor will throw an fsMetaException, if the provided id is not a positive integer value.
| ||||||||||||||||
| Misc. accessors | ||||||||||||||||
get Table Name
|
-
| |||||||||||||||
public getTableName ( )
| ||||||||||||||||
get Id
|
-
| |||||||||||||||
public getId ( )
| ||||||||||||||||
| Metadata accessors | ||||||||||||||||
get Value
| Retrieves the value of the given metadata field. | |||||||||||||||
public getValue ( $fieldname )
Retrieves the value of the given metadata field.
| ||||||||||||||||
set Value
| Set the given field to the given value. (more...) | |||||||||||||||
public setValue ( $fieldname, $value )
Set the given field to the given value. Note that you have to call the save() method to physically save the new data.
| ||||||||||||||||
get Values
| Returns an associative array containing all metadata values. (more...) | |||||||||||||||
public getValues ( )
Returns an associative array containing all metadata values. Useful for quickly passing metadata to templates and other read-only applications. | ||||||||||||||||
save
| Save changed values permanently in the database. | |||||||||||||||
public save ( )
Save changed values permanently in the database. | ||||||||||||||||
| Form input/output methods | ||||||||||||||||
add Elements
| Creates and configured a XoopsFormMetaData element for every group, and adds them to the given XoopsForm. (more...) | |||||||||||||||
public addElements ( &$form, $extra, $prefix )
Creates and configured a XoopsFormMetaData element for every group, and adds them to the given XoopsForm. Hint: This is the simplest method for adding metadata-inputs to your XoopsForm.
| ||||||||||||||||
get Element
| Creates and configures a XoopsFormMetaData element, that you can add to your form with [XoopsForm::addElement()]. | |||||||||||||||
public getElement ( $groupname, $prefix )
Creates and configures a XoopsFormMetaData element, that you can add to your form with [XoopsForm::addElement()].
| ||||||||||||||||
render
| Renders the field with the given fieldname as a form INPUT element. | |||||||||||||||
public render ( $fieldname, $prefix, $extra, $options )
Renders the field with the given fieldname as a form INPUT element.
| ||||||||||||||||
parse
| Parses a value from a POST or GET request, from an INPUT element rendered using the render() method, and returns a PHP-value (suitable for use with setValue). | |||||||||||||||
public parse ( $fieldname, $prefix, $post )
Parses a value from a POST or GET request, from an INPUT element rendered using the render() method, and returns a PHP-value (suitable for use with setValue).
| ||||||||||||||||
pickup
| Automatically pick up, parse and set values from a POST or GET request, from INPUT elements rendered using calls to render(). (more...) | |||||||||||||||
public pickup ( $prefix, $groupname, $post )
Automatically pick up, parse and set values from a POST or GET request, from INPUT elements rendered using calls to render(). You still have to manually call save() after calling this method. Hint: Use the XoopsFormMetaData class to easily add a group of fields to a XoopsForm.
| ||||||||||||||||
| Object removal | ||||||||||||||||
remove
| Remove this metadata object. | |||||||||||||||
public remove ( )
Remove this metadata object. | ||||||||||||||||
| Utility methods | ||||||||||||||||
get Table
| Returns the fsMetaTable object associated with the table of this object. | |||||||||||||||
public getTable ( )
Returns the fsMetaTable object associated with the table of this object. | ||||||||||||||||
get Fields
| Returns an array containing fsMetaField objects. | |||||||||||||||
public getFields ( $groupname )
Returns an array containing fsMetaField objects.
| ||||||||||||||||
| Internal helper functions | ||||||||||||||||
init Values
|
-
| |||||||||||||||
protected initValues ( )
| ||||||||||||||||
| Member Methods | |||||||||||||
| Method | Comments | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
~ fs Meta Factory
|
-
| ||||||||||||
public fsMetaFactory ( $tablename, $logic )
| |||||||||||||
| Logic control methods These methods enable you to build queries with complex logic. | |||||||||||||
begin Logic
| Start a new logic block. (more...) | ||||||||||||
public beginLogic ( $logic )
Start a new logic block. Any subsequent calls to criteria building methods, will add criteria to the new logic block. Once you have added all your criteria, you must call endLogic() to end the logic block. $logic: the logic to use when combining subsequent added criteria, e.g. "AND" or "OR".
| |||||||||||||
end Logic
| End the current logic block. (more...) | ||||||||||||
public endLogic ( )
End the current logic block. Any subsequent calls to criteria building methods, will add criteria to the parent logic block. | |||||||||||||
| Criteria building methods | |||||||||||||
add Criteria
| Most comparisons can be done with this method, for example: (more...) | ||||||||||||
public addCriteria ( $fieldname, $value, $operator )
Most comparisons can be done with this method, for example: $myfactory->addCriteria("email", "%@fyens.dk", "LIKE"); // "email" fields must end in "fyens.dk" $myfactory->addCriteria("interest", array("sport", "art"), "IN"); // "interest" fields must contain either "sport" or "art" $myfactory->addCriteria("age", 18, ">="); // "age" fields must contain values greater or equal to 18
| |||||||||||||
add Null
| Adds a null-comparison criteria: $fieldname must contain a NULL value ($null = true), or field value must NOT contain a NULL value ($null = false). | ||||||||||||
public addNull ( $fieldname, $null )
Adds a null-comparison criteria: $fieldname must contain a NULL value ($null = true), or field value must NOT contain a NULL value ($null = false).
| |||||||||||||
| Query methods | |||||||||||||
get Meta
| Executes the query and returns an associative array of fsMeta objects, using record ids as array-keys. (more...) | ||||||||||||
public getMeta ( )
Executes the query and returns an associative array of fsMeta objects, using record ids as array-keys. May return an empty array. | |||||||||||||
count
| Counts the number of records matching the criteria of this factory instance. | ||||||||||||
public count ( )
Counts the number of records matching the criteria of this factory instance. | |||||||||||||
touch
| Touches all records matching the criteria of this factory instance. (more...) | ||||||||||||
public touch ( )
Touches all records matching the criteria of this factory instance. Use this after an UPDATE query on metadata-tables, to ensure that cached values are refreshed by fsMeta. | |||||||||||||
| Helper functions The following helper functions are used internally, but are also useful to foreign factory classes. | |||||||||||||
get Expression
| Builds an expression you can use in the WHERE clause of an SQL statement. | ||||||||||||
public getExpression ( )
Builds an expression you can use in the WHERE clause of an SQL statement. | |||||||||||||
get Source
| Returns the source tablename, backtick-quoted, suitable for use in an SQL statement. | ||||||||||||
public getSource ( )
Returns the source tablename, backtick-quoted, suitable for use in an SQL statement. | |||||||||||||
get Key
| Returns the source table's primary key, fully qualified and backtick-quoted, suitable for use in an SQL statement. | ||||||||||||
public getKey ( )
Returns the source table's primary key, fully qualified and backtick-quoted, suitable for use in an SQL statement. | |||||||||||||
get Column
| Determines the column-name of the given field and value, returns a backtick-quoted, fully qualified column-name, suitable for use in a SQL statement - e.g. "`mytable`.`mycolumn`". (more...) | ||||||||||||
public getColumn ( $fieldname, $value )
Determines the column-name of the given field and value, returns a backtick-quoted, fully qualified column-name, suitable for use in a SQL statement - e.g. "`mytable`.`mycolumn`". If used with a multi-column field (such as fieldtype Multi) the value argument must be used. Note: this method returns null, if the given fieldname and value could not be resolved to a column-name.
| |||||||||||||
get Value
| Returns an SQL-value, suitable for use in a comparison expression in a WHERE clause. (more...) | ||||||||||||
public getValue ( $fieldname, &$value )
Returns an SQL-value, suitable for use in a comparison expression in a WHERE clause. Note: this method returns null, if the given fieldname and value could not be resolved to a column-name.
| |||||||||||||
| Private helper functions | |||||||||||||
_get S Q L
|
-
| ||||||||||||
private _getSQL ( &$node )
| |||||||||||||
This XoopsFormElement can be used to render groups of metadata editors.
Use the standard method setExtra() to inject additional attributes into the <table> tag, e.g. class="myclass", etc.
You can use the fsMeta::pickup method to easily pick up groups of posted metadata values.
| Member Methods | |||||||||||||||||||
| Method | Comments | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
~ Xoops Form Meta Data
|
-
| ||||||||||||||||||
public XoopsFormMetaData ( $caption, $name, $tablename, $id, $groupname )
| |||||||||||||||||||
render
|
-
| ||||||||||||||||||
public render ( )
| |||||||||||||||||||
A table represents a single physical table containing metadata, and provides access to fields.
A field is often the same as a physical column in the underlying table, but not as a rule - the fieldtype Multi, for example, uses multiple columns to store selections.
| Member Methods | ||||||||||
| Method | Comments | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
~ fs Meta Table
| You should not call the constructor directly - instead, please use the static getTable() method. | |||||||||
public static fsMetaTable ( $tablename, $values )
You should not call the constructor directly - instead, please use the static getTable() method.
| ||||||||||
| Instanciation | ||||||||||
get Table
| Returns an instance of fsMetaTable. (more...) | |||||||||
public static getTable ( $tablename )
Returns an instance of fsMetaTable. Warning: If no table with the given tablename exists, an empty table is created. Therefore you can NOT use this method simply to check if a table exists!
| ||||||||||
| Accessors | ||||||||||
get Table Name
|
-
| |||||||||
public getTableName ( )
| ||||||||||
get Title
|
-
| |||||||||
public getTitle ( )
| ||||||||||
set Title
|
-
| |||||||||
public setTitle ( $value )
| ||||||||||
get Description
|
-
| |||||||||
public getDescription ( )
| ||||||||||
set Description
|
-
| |||||||||
public setDescription ( $value )
| ||||||||||
| Field management methods | ||||||||||
get Fields
| Returns an array containing all the fsMetaField objects of this fsMetaTable. (more...) | |||||||||
public getFields ( $groupname )
Returns an array containing all the fsMetaField objects of this fsMetaTable. The returned associative array is indexed using fieldnames.
| ||||||||||
get Field
| Returns the fsMetaField object with the given fieldname. (more...) | |||||||||
public getField ( $fieldname )
Returns the fsMetaField object with the given fieldname. Returns null if no field with the given fieldname exists in this table.
| ||||||||||
create Field
| Creates and returns a new fsMetaField object with the given fieldname and fieldtype. (more...) | |||||||||
public createField ( $fieldname, $fieldtype )
Creates and returns a new fsMetaField object with the given fieldname and fieldtype. Throws an fsMetaException on failure, which could be due to duplicate fieldname, or invalid fieldtype.
| ||||||||||
| Utility methods | ||||||||||
get Schema
| Returns the Schema object for this table. | |||||||||
public getSchema ( )
Returns the Schema object for this table. | ||||||||||
get Groups
| Returns an array containing all fsMetaGroup objects associated with this table. (more...) | |||||||||
public getGroups ( )
Returns an array containing all fsMetaGroup objects associated with this table. The returned associative array is indexed using group-names. | ||||||||||
| Object creation | ||||||||||
create
| Creates and returns a new fsMetaTable with the given tablename. (more...) | |||||||||
public static create ( $tablename )
Creates and returns a new fsMetaTable with the given tablename. May throw an fsMetaException, and returns false, if a table with the given name already exists.
| ||||||||||
| Object removal | ||||||||||
remove
|
-
| |||||||||
public remove ( )
| ||||||||||
| Object retrieval | ||||||||||
get All
| Returns an array containing all fsMetaTable objects. | |||||||||
public static getAll ( $prefix )
Returns an array containing all fsMetaTable objects.
| ||||||||||
Field-type determines the kind of type-handler class used to manage the field, refer to the fsMetaType classes for more information.
Fields are always ordered, ascending, first by group number, then by priority.
Group name is optional, and can be used to group fields together - the fsMeta class, for example, has a render() method which takes a $groupname argument, which can be used to render only a certain group of fields.
Field-options refer to a small collection of special options for the type-handler's render() method, and so is typically used to change the behavior or layout of the rendered html inputs. Each type-handler has a disctinct set of available options - most don't have any. The fsMetaType_Select handler, for example, has a "mode" option that can be used to render the field as a dropdown or group of radio buttons.
A field is often the same as a physical column in the underlying table, but not as a rule - the fieldtype Multi, for example, uses multiple columns to store selections. Such fields also always have choices associated with them.
Generally, you can use getHandler() to get the handler of a field, then use the handlers isMultiColumn() method to check if the field uses one or more columns to store it's value.
For single-column fields, the physical column-name in the field's table is simply the fieldname, e.g. getFieldName().
For multi-column fields, each associated choice is related to a physical column in the underlying table. Column-names are composed of the fieldname, followed by two underscores "__", followed by the choice-index.
| Member Methods | ||||||||||||||||
| Method | Comments | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
~ fs Meta Field
|
-
| |||||||||||||||
public static fsMetaField ( $tablename, $fieldname, $values )
| ||||||||||||||||
| Accessors | ||||||||||||||||
get Table Name
|
-
| |||||||||||||||
public getTableName ( )
| ||||||||||||||||
get Field Name
|
-
| |||||||||||||||
public getFieldName ( )
| ||||||||||||||||
get Field Type
|
-
| |||||||||||||||
public getFieldType ( )
| ||||||||||||||||
get Priority
|
-
| |||||||||||||||
public getPriority ( )
| ||||||||||||||||
set Priority
|
-
| |||||||||||||||
public setPriority ( $value )
| ||||||||||||||||
get Title
|
-
| |||||||||||||||
public getTitle ( )
| ||||||||||||||||
set Title
|
-
| |||||||||||||||
public setTitle ( $value )
| ||||||||||||||||
get Hint
|
-
| |||||||||||||||
public getHint ( )
| ||||||||||||||||
set Hint
|
-
| |||||||||||||||
public setHint ( $value )
| ||||||||||||||||
get Description
|
-
| |||||||||||||||
public getDescription ( )
| ||||||||||||||||
set Description
|
-
| |||||||||||||||
public setDescription ( $value )
| ||||||||||||||||
get Group Name
|
-
| |||||||||||||||
public getGroupName ( )
| ||||||||||||||||
set Group Name
|
-
| |||||||||||||||
public setGroupName ( $groupname )
| ||||||||||||||||
get Field Options
| An associative array containing options for this field's handler. | |||||||||||||||
public getFieldOptions ( )
An associative array containing options for this field's handler. | ||||||||||||||||
set Field Options
|
-
| |||||||||||||||
public setFieldOptions ( $options )
| ||||||||||||||||
| Utility methods | ||||||||||||||||
get Handler
|
-
| |||||||||||||||
public getHandler ( )
| ||||||||||||||||
get Table
|
-
| |||||||||||||||
public getTable ( )
| ||||||||||||||||
| Form input/output methods | ||||||||||||||||
render
| Renders this field as HTML code, using $value as the current value. (more...) | |||||||||||||||
public render ( $value, $prefix, $extra, $options )
Renders this field as HTML code, using $value as the current value. (if you're looking for a way to render your metadata as HTML code, you most likely want the [fsMeta::render] method.)
| ||||||||||||||||
parse
| Parses a value submitted from a FORM built using calls to render(). (more...) | |||||||||||||||
public parse ( $prefix, $post )
Parses a value submitted from a FORM built using calls to render(). (if you're looking for a way to parse your metadata forms, you most likely want the [fsMeta::parse] method.)
| ||||||||||||||||
| Choice management methods | ||||||||||||||||
get Choices
| Returns all fsMetaChoice objects associated with this field. (more...) | |||||||||||||||
public getChoices ( $index_by, $use_cache )
Returns all fsMetaChoice objects associated with this field. The result is an associative array where the keys, by default, are the choice-indexes. May return an empty array.
| ||||||||||||||||
add Choice
| Creates and returns a new fsMetaChoice object for this field. (more...) | |||||||||||||||
public static addChoice ( $title, $value )
Creates and returns a new fsMetaChoice object for this field. Throws an fsMetaException on error.
| ||||||||||||||||
| Object creation | ||||||||||||||||
create
| Creates and returns a new fsMetaField, and associates it with the fsMetaTable with the given tablename. (more...) | |||||||||||||||
public static create ( $tablename, $fieldname, $fieldtype )
Creates and returns a new fsMetaField, and associates it with the fsMetaTable with the given tablename. May throw an fsMetaException if a field with the given fieldname already exists in the given table, or if the requested fieldtype is invalid.
| ||||||||||||||||
| Object removal | ||||||||||||||||
remove
|
-
| |||||||||||||||
public remove ( )
| ||||||||||||||||
| Object retrieval | ||||||||||||||||
get Field
| Returns an instance of a fsMetaField object - you should use this to acquire field objects, rather than the constructor. (more...) | |||||||||||||||
public static getField ( $tablename, $fieldname, &$cache_inject )
Returns an instance of a fsMetaField object - you should use this to acquire field objects, rather than the constructor. If the specified field can not be found, this method throws an fsMetaException. $cache_inject: this parameter is used internally for caching - you should not use it.
| ||||||||||||||||
get By Table Name
| Returns an associative array containing all fields for the given table. (more...) | |||||||||||||||
public static getByTableName ( $tablename, $groupname )
Returns an associative array containing all fields for the given table. The returned array is indexed using fieldnames.
| ||||||||||||||||
| Helper methods | ||||||||||||||||
is Valid Field Name
|
-
| |||||||||||||||
public static isValidFieldName ( $fieldname )
| ||||||||||||||||
| Member Methods | |||||||
| Method | Comments | ||||||
|---|---|---|---|---|---|---|---|
set Table Name
|
-
| ||||||
public setTableName ( $tablename )
| |||||||
set Field Name
|
-
| ||||||
public setFieldName ( $fieldname )
| |||||||
set Group Name
|
-
| ||||||
public setGroupName ( $groupname )
| |||||||
get Fields
|
-
| ||||||
public getFields ( $index_by )
| |||||||
This class implements a choice for a field (e.g. fields of type Select or Multi)
Choice-value refers to the underlying value of a choice - for example, when you get the value of a Select, this is the value that is returned.
Choices are idenitified by a triple-key: tablename, fieldname and index - the value of a Select or Multi is thus identified by the value's index, which means you can change the underlying choice-value of a choice without problems.
| Member Methods | ||||||||||||||||
| Method | Comments | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
~ fs Meta Choice
|
-
| |||||||||||||||
public fsMetaChoice ( $tablename, $fieldname, $index, $values )
| ||||||||||||||||
| Accessors | ||||||||||||||||
get Table Name
|
-
| |||||||||||||||
public getTableName ( )
| ||||||||||||||||
get Field Name
|
-
| |||||||||||||||
public getFieldName ( )
| ||||||||||||||||
get Index
|
-
| |||||||||||||||
public getIndex ( )
| ||||||||||||||||
get Title
|
-
| |||||||||||||||
public getTitle ( )
| ||||||||||||||||
set Title
|
-
| |||||||||||||||
public setTitle ( $value )
| ||||||||||||||||
get Choice Value
|
-
| |||||||||||||||
public getChoiceValue ( )
| ||||||||||||||||
set Choice Value
|
-
| |||||||||||||||
public setChoiceValue ( $value )
| ||||||||||||||||
get Priority
|
-
| |||||||||||||||
public getPriority ( )
| ||||||||||||||||
set Priority
|
-
| |||||||||||||||
public setPriority ( $value )
| ||||||||||||||||
| Utility methods | ||||||||||||||||
get Field
|
-
| |||||||||||||||
public getField ( )
| ||||||||||||||||
get Column Name
|
-
| |||||||||||||||
public getColumnName ( )
| ||||||||||||||||
| Object creation | ||||||||||||||||
create
| Creates and returns a new fsMetaChoice object. (more...) | |||||||||||||||
public static create ( $tablename, $fieldname, $title, $value )
Creates and returns a new fsMetaChoice object. Throws an fsMetaException if the provided title or value are invalid or missing, or if the provided tablename/fieldname does not exist.
| ||||||||||||||||
| Object removal | ||||||||||||||||
remove
|
-
| |||||||||||||||
public remove ( )
| ||||||||||||||||
| Member Methods | |||||||
| Method | Comments | ||||||
|---|---|---|---|---|---|---|---|
set Table Name
|
-
| ||||||
public setTableName ( $tablename )
| |||||||
set Field Name
|
-
| ||||||
public setFieldName ( $fieldname )
| |||||||
set Choice Value
|
-
| ||||||
public setChoiceValue ( $value )
| |||||||
get Choices
|
-
| ||||||
public getChoices ( $index_by )
| |||||||
This class provides utility functions related to field-type handlers.
You should not create instances of this class - all of its methods are static.
| Member Methods | |||||||
| Method | Comments | ||||||
|---|---|---|---|---|---|---|---|
is Valid Type
| Use this function to check if the given typename is a valid typename. | ||||||
public static isValidType ( $typename )
Use this function to check if the given typename is a valid typename.
| |||||||
get Valid Types
| Returns an array of valid metatypenames. | ||||||
public static getValidTypes ( )
Returns an array of valid metatypenames. | |||||||
get Handler
| Returns a global instance of the given metatype handler. | ||||||
public static getHandler ( $typename )
Returns a global instance of the given metatype handler.
| |||||||
This abstract class defines abstract and default methods for all field-type handlers.
| Member Methods | |||||||||||||
| Method | Comments | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
is Multi Column
| Returns true if this field uses multiple columns to store its value. (more...) | ||||||||||||
public static isMultiColumn ( )
Returns true if this field uses multiple columns to store its value. By default, all metatypes are single-column - multi-column types need to override this default method. | |||||||||||||
has Choices
| Returns true if this field-type can have choices. (more...) | ||||||||||||
public hasChoices ( )
Returns true if this field-type can have choices. By default, metatypes can not have choices - types that need choices must override this default method. | |||||||||||||
render Options
| Returns an array of form-elements specific to a field-type. (more...) | ||||||||||||
public renderOptions ( $prefix, &$options )
Returns an array of form-elements specific to a field-type. The generated form-elements are prefixed with the given string. Use parseOptions() with the same prefix to parse the posted options. (admin/meta_field.php uses this method to display a field's options)
| |||||||||||||
parse Options
| Parses posted options, returns an associative array. (more...) | ||||||||||||
public parseOptions ( $prefix )
Parses posted options, returns an associative array. Use renderOptions() to render form-elements (admin/meta_field_save.php uses this method to save a field's options)
| |||||||||||||
init Column
| Initializes type and length (etc.) for the given SchemaColumn object, according to a type's specific requirements | ||||||||||||
public abstract initColumn ( )
Initializes type and length (etc.) for the given SchemaColumn object, according to a type's specific requirements | |||||||||||||
encode
| Encode (and quote) a given PHP-value as an SQL-value | ||||||||||||
public abstract encode ( )
Encode (and quote) a given PHP-value as an SQL-value | |||||||||||||
decode
| Decode a given SQL-value to a PHP-value | ||||||||||||
public abstract decode ( )
Decode a given SQL-value to a PHP-value | |||||||||||||
render
| Renders a given field as an HTML input with the given current value. | ||||||||||||
public abstract render ( )
Renders a given field as an HTML input with the given current value. | |||||||||||||
parse
| This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue]) | ||||||||||||
public parse ( &$field, $prefix, $post )
This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue])
| |||||||||||||
This handler implements a simple string, stored in a VARCHAR(255) column
| Member Methods | |||||||||||||||||||
| Method | Comments | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encode
|
-
| ||||||||||||||||||
public encode ( &$field, $value )
| |||||||||||||||||||
decode
|
-
| ||||||||||||||||||
public decode ( &$field, $value )
| |||||||||||||||||||
init Column
|
-
| ||||||||||||||||||
public initColumn ( &$column )
| |||||||||||||||||||
render
|
-
| ||||||||||||||||||
public render ( &$field, $value, $prefix, $extra, $options )
| |||||||||||||||||||
| [fsMetaType] | |||||||||||||||||||
is Multi Column
| Returns true if this field uses multiple columns to store its value. (more...) | ||||||||||||||||||
public static isMultiColumn ( )
Returns true if this field uses multiple columns to store its value. By default, all metatypes are single-column - multi-column types need to override this default method. | |||||||||||||||||||
has Choices
| Returns true if this field-type can have choices. (more...) | ||||||||||||||||||
public hasChoices ( )
Returns true if this field-type can have choices. By default, metatypes can not have choices - types that need choices must override this default method. | |||||||||||||||||||
render Options
| Returns an array of form-elements specific to a field-type. (more...) | ||||||||||||||||||
public renderOptions ( $prefix, &$options )
Returns an array of form-elements specific to a field-type. The generated form-elements are prefixed with the given string. Use parseOptions() with the same prefix to parse the posted options. (admin/meta_field.php uses this method to display a field's options)
| |||||||||||||||||||
parse Options
| Parses posted options, returns an associative array. (more...) | ||||||||||||||||||
public parseOptions ( $prefix )
Parses posted options, returns an associative array. Use renderOptions() to render form-elements (admin/meta_field_save.php uses this method to save a field's options)
| |||||||||||||||||||
parse
| This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue]) | ||||||||||||||||||
public parse ( &$field, $prefix, $post )
This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue])
| |||||||||||||||||||
This handler implements a large string, stored in a TEXT column
| Member Methods | |||||||||||||||||||
| Method | Comments | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
init Column
|
-
| ||||||||||||||||||
public initColumn ( &$column )
| |||||||||||||||||||
render
|
-
| ||||||||||||||||||
public render ( &$field, $value, $prefix, $extra, $options )
| |||||||||||||||||||
| [fsMetaType_String] | |||||||||||||||||||
encode
|
-
| ||||||||||||||||||
public encode ( &$field, $value )
| |||||||||||||||||||
decode
|
-
| ||||||||||||||||||
public decode ( &$field, $value )
| |||||||||||||||||||
| [fsMetaType_String] :: [fsMetaType] | |||||||||||||||||||
is Multi Column
| Returns true if this field uses multiple columns to store its value. (more...) | ||||||||||||||||||
public static isMultiColumn ( )
Returns true if this field uses multiple columns to store its value. By default, all metatypes are single-column - multi-column types need to override this default method. | |||||||||||||||||||
has Choices
| Returns true if this field-type can have choices. (more...) | ||||||||||||||||||
public hasChoices ( )
Returns true if this field-type can have choices. By default, metatypes can not have choices - types that need choices must override this default method. | |||||||||||||||||||
render Options
| Returns an array of form-elements specific to a field-type. (more...) | ||||||||||||||||||
public renderOptions ( $prefix, &$options )
Returns an array of form-elements specific to a field-type. The generated form-elements are prefixed with the given string. Use parseOptions() with the same prefix to parse the posted options. (admin/meta_field.php uses this method to display a field's options)
| |||||||||||||||||||
parse Options
| Parses posted options, returns an associative array. (more...) | ||||||||||||||||||
public parseOptions ( $prefix )
Parses posted options, returns an associative array. Use renderOptions() to render form-elements (admin/meta_field_save.php uses this method to save a field's options)
| |||||||||||||||||||
parse
| This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue]) | ||||||||||||||||||
public parse ( &$field, $prefix, $post )
This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue])
| |||||||||||||||||||
This handler implements a signed integer number, stored in an INT column
| Member Methods | |||||||||||||||||||
| Method | Comments | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encode
|
-
| ||||||||||||||||||
public encode ( &$field, $value )
| |||||||||||||||||||
decode
|
-
| ||||||||||||||||||
public decode ( &$field, $value )
| |||||||||||||||||||
init Column
|
-
| ||||||||||||||||||
public initColumn ( &$column )
| |||||||||||||||||||
render
|
-
| ||||||||||||||||||
public render ( &$field, $value, $prefix, $extra, $options )
| |||||||||||||||||||
parse
|
-
| ||||||||||||||||||
public parse ( &$field, $prefix, $post )
| |||||||||||||||||||
| [fsMetaType] | |||||||||||||||||||
is Multi Column
| Returns true if this field uses multiple columns to store its value. (more...) | ||||||||||||||||||
public static isMultiColumn ( )
Returns true if this field uses multiple columns to store its value. By default, all metatypes are single-column - multi-column types need to override this default method. | |||||||||||||||||||
has Choices
| Returns true if this field-type can have choices. (more...) | ||||||||||||||||||
public hasChoices ( )
Returns true if this field-type can have choices. By default, metatypes can not have choices - types that need choices must override this default method. | |||||||||||||||||||
render Options
| Returns an array of form-elements specific to a field-type. (more...) | ||||||||||||||||||
public renderOptions ( $prefix, &$options )
Returns an array of form-elements specific to a field-type. The generated form-elements are prefixed with the given string. Use parseOptions() with the same prefix to parse the posted options. (admin/meta_field.php uses this method to display a field's options)
| |||||||||||||||||||
parse Options
| Parses posted options, returns an associative array. (more...) | ||||||||||||||||||
public parseOptions ( $prefix )
Parses posted options, returns an associative array. Use renderOptions() to render form-elements (admin/meta_field_save.php uses this method to save a field's options)
| |||||||||||||||||||
This handler implements a date and time field, stored in a DATETIME column
| Member Methods | |||||||||||||||||||
| Method | Comments | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encode
|
-
| ||||||||||||||||||
public encode ( &$field, $value )
| |||||||||||||||||||
decode
|
-
| ||||||||||||||||||
public decode ( &$field, $value )
| |||||||||||||||||||
init Column
|
-
| ||||||||||||||||||
public initColumn ( &$column )
| |||||||||||||||||||
render
|
-
| ||||||||||||||||||
public render ( &$field, $value, $prefix, $extra, $options )
| |||||||||||||||||||
parse
|
-
| ||||||||||||||||||
public parse ( &$field, $prefix, $post )
| |||||||||||||||||||
| [fsMetaType] | |||||||||||||||||||
is Multi Column
| Returns true if this field uses multiple columns to store its value. (more...) | ||||||||||||||||||
public static isMultiColumn ( )
Returns true if this field uses multiple columns to store its value. By default, all metatypes are single-column - multi-column types need to override this default method. | |||||||||||||||||||
has Choices
| Returns true if this field-type can have choices. (more...) | ||||||||||||||||||
public hasChoices ( )
Returns true if this field-type can have choices. By default, metatypes can not have choices - types that need choices must override this default method. | |||||||||||||||||||
render Options
| Returns an array of form-elements specific to a field-type. (more...) | ||||||||||||||||||
public renderOptions ( $prefix, &$options )
Returns an array of form-elements specific to a field-type. The generated form-elements are prefixed with the given string. Use parseOptions() with the same prefix to parse the posted options. (admin/meta_field.php uses this method to display a field's options)
| |||||||||||||||||||
parse Options
| Parses posted options, returns an associative array. (more...) | ||||||||||||||||||
public parseOptions ( $prefix )
Parses posted options, returns an associative array. Use renderOptions() to render form-elements (admin/meta_field_save.php uses this method to save a field's options)
| |||||||||||||||||||
This handler implements single selection from a collection of choices, stored as a single INT column.
The stored value is the choice-index of the selected choice.
| Member Methods | |||||||||||||||||||
| Method | Comments | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encode
|
-
| ||||||||||||||||||
public encode ( &$field, $value )
| |||||||||||||||||||
decode
|
-
| ||||||||||||||||||
public decode ( &$field, $value )
| |||||||||||||||||||
init Column
|
-
| ||||||||||||||||||
public initColumn ( &$column )
| |||||||||||||||||||
has Choices
|
-
| ||||||||||||||||||
public hasChoices ( )
| |||||||||||||||||||
render Options
|
-
| ||||||||||||||||||
public renderOptions ( $prefix, &$options )
| |||||||||||||||||||
parse Options
|
-
| ||||||||||||||||||
public parseOptions ( $prefix )
| |||||||||||||||||||
render
|
-
| ||||||||||||||||||
public render ( &$field, $value, $prefix, $extra, $options )
| |||||||||||||||||||
| [fsMetaType] | |||||||||||||||||||
is Multi Column
| Returns true if this field uses multiple columns to store its value. (more...) | ||||||||||||||||||
public static isMultiColumn ( )
Returns true if this field uses multiple columns to store its value. By default, all metatypes are single-column - multi-column types need to override this default method. | |||||||||||||||||||
parse
| This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue]) | ||||||||||||||||||
public parse ( &$field, $prefix, $post )
This returns a value from a FORM, via POST or GET request, and translates it to a PHP-value (e.g. compatible with [fsMeta::setValue])
| |||||||||||||||||||
This class implements multiple selections from a collection of choices, stored as one TINYINT column per choice.
On the PHP-side, the selections are read/written as associative arrays, containing one element per available choice. The keys of this array, are choice-values, and the value of each element is a boolean true/false.
| Member Methods | |||||||||||||||||||
| Method | Comments | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encode
|
-
| ||||||||||||||||||
public encode ( &$field, $value )
| |||||||||||||||||||
decode
|
-
| ||||||||||||||||||
public decode ( &$field, $value )
| |||||||||||||||||||
init Column
|
-
| ||||||||||||||||||
public initColumn ( &$column )
| |||||||||||||||||||
is Multi Column
|
-
| ||||||||||||||||||
public isMultiColumn ( )
| |||||||||||||||||||
has Choices
|
-
| ||||||||||||||||||
public hasChoices ( )
| |||||||||||||||||||
render Options
|
-
| ||||||||||||||||||
public renderOptions ( $prefix, &$options )
| |||||||||||||||||||
parse Options
|
-
| ||||||||||||||||||
public parseOptions ( $prefix )
| |||||||||||||||||||
render
|
-
| ||||||||||||||||||
public render ( &$field, $value, $prefix, $extra, $options )
| |||||||||||||||||||
parse
|
-
| ||||||||||||||||||
public parse ( &$field, $prefix, $post )
| |||||||||||||||||||
This is the main include file of fsMeta - all required classes will be loaded by this include.
You can safely include this file several times - it will only load once.
XoopsForm element classes are automatically loaded, if the XoopsForm class has already been loaded.