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
파일 보기 프로젝트 열기: metamodels/core 1 사용 예제들

공개 메소드들

메소드 설명
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