PHP 클래스 FluentExtension

저자: Damian Mooyman ([email protected])
상속: extends DataExtension
파일 보기 프로젝트 열기: tractorcow/silverstripe-fluent 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_enable_write_augmentation
$disable_fluent_fields boolean Hook allowing temporary disabling of extra fluent fields
$translated_fields_for_cache array Cache for list of translated fields for all inspected classes

공개 메소드들

메소드 설명
BaseURLForLocale ( string $locale = null ) : string Determine the baseurl within a specified $locale.
CurrentLocale ( ) : string Current locale code
LocaleInformation ( string $locale = null ) : ArrayData Retrieves information about this object in the specified locale
LocaleLink ( string $locale ) : string Determine the link to this object given the specified $locale.
Locales ( ) : ArrayList Templatable list of all locales
augmentDataQueryCreation ( SQLQuery $query, DataQuery $dataQuery ) Amend freshly created DataQuery objects with the current locale and frontend status
augmentSQL ( SQLQuery &$query, DataQuery &$dataQuery = null )
augmentWrite ( &$manipulation )
base_indexes ( $class )
generate_extra_config ( string $class ) Generates the extra DB fields for a class (not including subclasses)
get_extra_config ( $class, $extension, $args )
isFieldNullable ( string $field ) : boolean Can this field be left empty?
onBeforeWrite ( )
set_enable_write_augmentation ( $enabled ) * Enable or disable write augmentations. Useful for setting up test cases with specific hard coded values.
translated_fields_for ( $class ) : array Determines the fields to translate on the given class
updateCMSFields ( FieldList $fields )

보호된 메소드들

메소드 설명
addLocaleIndicatorMessage ( FieldList $fields ) Adds a UI message to indicate whether you're editing in the default locale or not
detectFilterColumn ( string $condition, array $includedTables ) : array Determines the table/column identifier that first appears in the $condition, and returns the localised version of that column.
determine_index_type ( type $spec ) : string Given an index spec determines the index type
explode_column_string ( string $spec ) : array Splits a spec string safely, considering quoted columns, whitespace, and cleaning brackets
getTranslatedTables ( ) : array Get all database tables in the class ancestry and their respective translatable fields
implode_column_list ( array $columns ) : string Builds a properly quoted column list from an array
localiseFilterCondition ( string $condition, array $includedTables, string $locale ) : string Replaces all columns in the given condition with any localised
localiseSelect ( string $class, string $select, string $fallback ) : string Generates a select fragment based on a field with a fallback
parse_index_spec ( $name, string | array $spec ) : array Converts an array or string index spec into a universally useful array
quote_column_spec_string ( string $spec ) : string Given an index specification in the form of a string ensure that each column name is property quoted, stripping brackets and modifiers.
without_fluent_fields ( callback $callback ) : mixed Executes a callback with extra fluent fields disabled

메소드 상세

BaseURLForLocale() 공개 메소드

Determine the baseurl within a specified $locale.
public BaseURLForLocale ( string $locale = null ) : string
$locale string Locale, or null to use current locale
리턴 string

CurrentLocale() 공개 메소드

Current locale code
public CurrentLocale ( ) : string
리턴 string Locale code

LocaleInformation() 공개 메소드

Retrieves information about this object in the specified locale
public LocaleInformation ( string $locale = null ) : ArrayData
$locale string The locale information to request, or null to use the default locale
리턴 ArrayData Mapped list of locale properties

Locales() 공개 메소드

Templatable list of all locales
public Locales ( ) : ArrayList
리턴 ArrayList

addLocaleIndicatorMessage() 보호된 메소드

Adds a UI message to indicate whether you're editing in the default locale or not
protected addLocaleIndicatorMessage ( FieldList $fields )
$fields FieldList

augmentDataQueryCreation() 공개 메소드

Amend freshly created DataQuery objects with the current locale and frontend status
public augmentDataQueryCreation ( SQLQuery $query, DataQuery $dataQuery )
$query SQLQuery
$dataQuery DataQuery

augmentSQL() 공개 메소드

public augmentSQL ( SQLQuery &$query, DataQuery &$dataQuery = null )
$query SQLQuery
$dataQuery DataQuery

augmentWrite() 공개 메소드

public augmentWrite ( &$manipulation )

base_indexes() 공개 정적인 메소드

public static base_indexes ( $class )

detectFilterColumn() 보호된 메소드

Determines the table/column identifier that first appears in the $condition, and returns the localised version of that column.
protected detectFilterColumn ( string $condition, array $includedTables ) : array
$condition string Condition SQL string
$includedTables array
리턴 array Array with items [$table, $column], or null if not found

determine_index_type() 보호된 정적인 메소드

Given an index spec determines the index type
protected static determine_index_type ( type $spec ) : string
$spec type
리턴 string

explode_column_string() 보호된 정적인 메소드

Splits a spec string safely, considering quoted columns, whitespace, and cleaning brackets
protected static explode_column_string ( string $spec ) : array
$spec string The input index specification
리턴 array List of columns in the spec

generate_extra_config() 공개 정적인 메소드

Generates the extra DB fields for a class (not including subclasses)
public static generate_extra_config ( string $class )
$class string

getTranslatedTables() 보호된 메소드

Get all database tables in the class ancestry and their respective translatable fields
protected getTranslatedTables ( ) : array
리턴 array

get_extra_config() 공개 정적인 메소드

public static get_extra_config ( $class, $extension, $args )

implode_column_list() 보호된 정적인 메소드

Builds a properly quoted column list from an array
protected static implode_column_list ( array $columns ) : string
$columns array List of columns to implode
리턴 string A properly quoted list of column names

isFieldNullable() 공개 메소드

Can this field be left empty?
public isFieldNullable ( string $field ) : boolean
$field string
리턴 boolean False if the field inherits, true if it is nullable

localiseFilterCondition() 보호된 메소드

Replaces all columns in the given condition with any localised
protected localiseFilterCondition ( string $condition, array $includedTables, string $locale ) : string
$condition string Condition SQL string
$includedTables array
$locale string Locale to localise to
리턴 string $condition parameter with column names replaced

localiseSelect() 보호된 메소드

Generates a select fragment based on a field with a fallback
protected localiseSelect ( string $class, string $select, string $fallback ) : string
$class string Table/Class name
$select string Column to select from
$fallback string Column to fallback to if $select is empty
리턴 string Select fragment

onBeforeWrite() 공개 메소드

public onBeforeWrite ( )

parse_index_spec() 보호된 정적인 메소드

Converts an array or string index spec into a universally useful array
protected static parse_index_spec ( $name, string | array $spec ) : array
$spec string | array
리턴 array The resulting spec array with the required fields name, type, and value

quote_column_spec_string() 보호된 정적인 메소드

This index may also be in the form of a "CREATE INDEX..." sql fragment
protected static quote_column_spec_string ( string $spec ) : string
$spec string The input specification or query. E.g. 'unique (Column1, Column2)'
리턴 string The properly quoted column list. E.g. '"Column1", "Column2"'

set_enable_write_augmentation() 공개 정적인 메소드

* Enable or disable write augmentations. Useful for setting up test cases with specific hard coded values.
public static set_enable_write_augmentation ( $enabled )
$enabled

translated_fields_for() 공개 정적인 메소드

Determines the fields to translate on the given class
public static translated_fields_for ( $class ) : array
리턴 array List of field names and data types

updateCMSFields() 공개 메소드

public updateCMSFields ( FieldList $fields )
$fields FieldList

without_fluent_fields() 보호된 정적인 메소드

Executes a callback with extra fluent fields disabled
protected static without_fluent_fields ( callback $callback ) : mixed
$callback callback
리턴 mixed

프로퍼티 상세

$_enable_write_augmentation 보호되어 있는 정적으로 프로퍼티

protected static $_enable_write_augmentation

$disable_fluent_fields 보호되어 있는 정적으로 프로퍼티

Hook allowing temporary disabling of extra fluent fields
protected static bool $disable_fluent_fields
리턴 boolean

$translated_fields_for_cache 보호되어 있는 정적으로 프로퍼티

Cache for list of translated fields for all inspected classes
protected static array $translated_fields_for_cache
리턴 array