PHP Класс Craft\NeoFieldType

Наследование: extends craft\BaseFieldType, implements craft\IEagerLoadingFieldType
Показать файл Открыть проект

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

Метод Описание
defineContentAttribute ( ) : boolean Disables using the built-in content column for storing values. We will manage field values ourselves.
getEagerLoadingMap ( craft\BaseElementModel[] $sourceElements ) : array Returns an array that maps source-to-target element IDs based on this custom field.
getInputHtml ( string $name, array $value ) : string Builds the HTML for the input field.
getName ( ) Public methods
getSearchKeywords ( array $value ) : string Returns the search keywords that should be associated with this field.
getSettingsHtml ( ) : string Builds the HTML for the configurator.
getStaticHtml ( array $value ) : string Builds the HTML for the non-editable input field.
modifyElementsQuery ( craft\DbCommand $query, mixed $value ) : boolean | null Modifies the element query.
onAfterElementSave ( )
onAfterSave ( ) Saves the actual field type settings after the field type is saved.
onBeforeDelete ( ) Cleans up the field and all it's settings after it gets deleted.
prepSettings ( array $settings ) : Neo_SettingsModel Prepares the Neo field settings before they're saved to the database.
prepValue ( array $value ) : Neo_CriteriaModel Prepares the field's value for use in templates.
prepValueFromPost ( array $data ) : array Converts the field's input value from post data to what it should be stored as in the database.
validate ( array $blocks ) : array | boolean Validates the field's value (blocks).

Защищенные методы

Метод Описание
getSettingsModel ( ) Protected methods

Приватные методы

Метод Описание
_getNamespaceDepth ( ) : integer Returns what current depth the field is nested.
_includeResources ( string $class, array $settings = [] ) Includes the resource (Javascript) files for when outputting the settings or input HTML.
_prepareInputHtml ( integer $id, string $name, array $settings, array $value, boolean | false $static = false ) Actually builds the HTML for the input field. The other one just calls this method.

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

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

Disables using the built-in content column for storing values. We will manage field values ourselves.
public defineContentAttribute ( ) : boolean
Результат boolean

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

Returns an array that maps source-to-target element IDs based on this custom field.
public getEagerLoadingMap ( craft\BaseElementModel[] $sourceElements ) : array
$sourceElements craft\BaseElementModel[]
Результат array

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

Builds the HTML for the input field.
public getInputHtml ( string $name, array $value ) : string
$name string
$value array
Результат string

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

Public methods
public getName ( )

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

Returns the search keywords that should be associated with this field.
public getSearchKeywords ( array $value ) : string
$value array
Результат string

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

Builds the HTML for the configurator.
public getSettingsHtml ( ) : string
Результат string

getSettingsModel() защищенный Метод

Protected methods
protected getSettingsModel ( )

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

Builds the HTML for the non-editable input field.
public getStaticHtml ( array $value ) : string
$value array
Результат string

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

Modifies the element query.
public modifyElementsQuery ( craft\DbCommand $query, mixed $value ) : boolean | null
$query craft\DbCommand
$value mixed
Результат boolean | null

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

public onAfterElementSave ( )

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

Saves the actual field type settings after the field type is saved.
public onAfterSave ( )

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

Cleans up the field and all it's settings after it gets deleted.
public onBeforeDelete ( )

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

Handles preparing block types, field layouts and groups.
public prepSettings ( array $settings ) : Neo_SettingsModel
$settings array
Результат Neo_SettingsModel

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

Prepares the field's value for use in templates.
public prepValue ( array $value ) : Neo_CriteriaModel
$value array
Результат Neo_CriteriaModel

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

Converts the field's input value from post data to what it should be stored as in the database.
public prepValueFromPost ( array $data ) : array
$data array
Результат array

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

Validates the field's value (blocks).
public validate ( array $blocks ) : array | boolean
$blocks array
Результат array | boolean