PHP Класс MetaModels\Attribute\BaseSimple

Simple fields are fields that only consist of one column in the metamodel table and therefore do not need to be handled as complex fields must be.
Наследование: extends Base, implements MetaModels\Attribute\ISimple
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
createColumn ( ) : void Creates the underlying database structure for this field.
deleteColumn ( ) : void Removes the underlying database structure for this field.
destroyAUX ( ) : void Create auxiliary data like a column in the MetaModel table or references in another table etc.
getFilterOptions ( $idList, $usedOnly, &$arrCount = null ) {@inheritDoc}
getSQLDataType ( ) : string Returns the SQL primitive type declaration in MySQL notation.
handleMetaChange ( string $strMetaName, mixed $varNewValue ) : MetaModels\Attribute\IAttribute Updates the meta information of the attribute.
initializeAUX ( ) : void Delete all auxiliary data like a column in the MetaModel table or references in another table etc.
renameColumn ( string $strNewColumnName ) : void Renames the underlying database structure for this field.
searchFor ( string $strPattern ) : int[] Search all items that match the given expression.
serializeData ( mixed $value ) : string Take the unserialized data and serialize it for the native DB column.
setDataFor ( mixed $arrValues ) : void This method is called to store the data for certain items to the database.
sortIds ( $idList, $strDirection )
unserializeData ( string $value ) : mixed Take the raw data from the DB column and unserialize it.

Описание методов

createColumn() публичный Метод

You have to override this function in field types, when you want to have multi column structure etc.
public createColumn ( ) : void
Результат void

deleteColumn() публичный Метод

Removes the underlying database structure for this field.
public deleteColumn ( ) : void
Результат void

destroyAUX() публичный Метод

Create auxiliary data like a column in the MetaModel table or references in another table etc.
public destroyAUX ( ) : void
Результат void

getFilterOptions() публичный Метод

{@inheritDoc}
public getFilterOptions ( $idList, $usedOnly, &$arrCount = null )

getSQLDataType() публичный Метод

In this base class a sane value of "blob" allowing NULL is used. Deriving classes SHOULD override this function.
public getSQLDataType ( ) : string
Результат string 'blob NULL'

handleMetaChange() публичный Метод

This tells the attribute to perform any actions that must be done to correctly initialize the new value and to perform any action to undo the changes that had been done for the previous value. i.e.: when an attribute type needs columns in an an auxiliary table, these will have to be updated herein. This method may throw an exception, when the new value is invalid or any problems appear, the MetaModelAttribute will then keep the old meta value.
public handleMetaChange ( string $strMetaName, mixed $varNewValue ) : MetaModels\Attribute\IAttribute
$strMetaName string Name of the meta information that shall be updated.
$varNewValue mixed The new value for this meta information.
Результат MetaModels\Attribute\IAttribute The instance of this attribute, to support chaining.

initializeAUX() публичный Метод

Delete all auxiliary data like a column in the MetaModel table or references in another table etc.
public initializeAUX ( ) : void
Результат void

renameColumn() публичный Метод

Renames the underlying database structure for this field.
public renameColumn ( string $strNewColumnName ) : void
$strNewColumnName string The new column name.
Результат void

searchFor() публичный Метод

Base implementation, perform string matching search. The standard wildcards * (many characters) and ? (a single character) are supported.
public searchFor ( string $strPattern ) : int[]
$strPattern string The text to search for. This may contain wildcards.
Результат int[] the ids of matching items.

serializeData() публичный Метод

Take the unserialized data and serialize it for the native DB column.
public serializeData ( mixed $value ) : string
$value mixed The input value.
Результат string

setDataFor() публичный Метод

This method is called to store the data for certain items to the database.
public setDataFor ( mixed $arrValues ) : void
$arrValues mixed The values to be stored into database. Mapping is item id=>value.
Результат void

sortIds() публичный Метод

This base implementation does a plain SQL sort by native value as defined by MySQL.
public sortIds ( $idList, $strDirection )

unserializeData() публичный Метод

Take the raw data from the DB column and unserialize it.
public unserializeData ( string $value ) : mixed
$value string The input value.
Результат mixed