PHP 클래스 Craft\NeoFieldType

상속: extends craft\BaseFieldType, implements craft\IEagerLoadingFieldType
파일 보기 프로젝트 열기: benjamminf/craft-neo

공개 메소드들

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