FluentSiteTree
class FluentSiteTree extends FluentExtension (View source)
SiteTree extension class for translatable objects
Properties
protected | SS_Object | $owner | The object this extension is applied to. |
from Extension |
protected | DataObject | $ownerBaseClass | The base class that this extension was applied to; $this->owner must be one of these |
from Extension |
public | $class | from Extension | ||
protected static | bool | $disable_fluent_fields | Hook allowing temporary disabling of extra fluent fields |
from FluentExtension |
protected static | array | $translated_fields_for_cache | Cache for list of translated fields for all inspected classes |
from FluentExtension |
protected static | $_enable_write_augmentation | from FluentExtension |
Methods
Called when this extension is added to a particular class
Helper method to strip eval'ed arguments from a string thats passed to DataObject::$extensions or Object::add_extension().
Edit the given query object to support queries for this extension
Update the database schema as required by this extension.
Define extra database fields
This function is used to provide modifications to the form used for front end forms. DataObject->getFrontEndFields()
This is used to provide modifications to the form actions used in the CMS. DataObject->getCMSActions().
this function is used to provide modifications to the summary fields in CMS by the extension By default, the summaryField() of its owner will merge more fields defined in the extension's $extra_fields['summary_fields']
this function is used to provide modifications to the fields labels in CMS by the extension By default, the fieldLabels() of its owner will merge more fields defined in the extension's $extra_fields['field_labels']
Executes a callback with extra fluent fields disabled
Determines the fields to translate on the given class
Get all database tables in the class ancestry and their respective translatable fields
Splits a spec string safely, considering quoted columns, whitespace, and cleaning brackets
Builds a properly quoted column list from an array
Given an index specification in the form of a string ensure that each column name is property quoted, stripping brackets and modifiers.
Given an index spec determines the index type
Converts an array or string index spec into a universally useful array
Generates the extra DB fields for a class (not including subclasses)
Determine the link to this object given the specified $locale.
Determine the baseurl within a specified $locale.
Retrieves information about this object in the specified locale
Amend freshly created DataQuery objects with the current locale and frontend status
Determines the table/column identifier that first appears in the $condition, and returns the localised version of that column.
Replaces all columns in the given condition with any localised
Generates a select fragment based on a field with a fallback
Adds a UI message to indicate whether you're editing in the default locale or not
Ensure that the controller is correctly initialised
Details
__construct()
No description
static
add_to_class(string $class, string $extensionClass, mixed $args = null)
Called when this extension is added to a particular class
setOwner(SS_Object $owner, string $ownerBaseClass = null)
Set the owner of this extension.
clearOwner()
No description
SS_Object
getOwner()
Returns the owner of this extension.
static string
get_classname_without_arguments(string $extensionStr)
Helper method to strip eval'ed arguments from a string thats passed to DataObject::$extensions or Object::add_extension().
static
get_extra_config($class, $extension, $args)
No description
static
unload_extra_statics($class, $extension)
No description
validate(ValidationResult $validationResult)
Hook for extension-specific validation.
augmentSQL(SQLQuery $query, DataQuery $dataQuery = null)
Edit the given query object to support queries for this extension
augmentDatabase()
Update the database schema as required by this extension.
When duplicating a table's structure, remember to duplicate the create options as well. See Versioned->augmentDatabase for an example.
augmentWrite(array $manipulation)
Augment a write-record request.
onBeforeWrite()
No description
onAfterWrite()
No description
onBeforeDelete()
No description
onAfterDelete()
No description
requireDefaultRecords()
No description
populateDefaults()
No description
can($member)
No description
canEdit($member)
No description
canDelete($member)
No description
canCreate($member)
No description
array
extraStatics($class = null, $extension = null)
Define extra database fields
Return a map where the keys are db, has_one, etc, and the values are additional fields/relations to be defined.
updateCMSFields(FieldList $fields)
No description
updateFrontEndFields(FieldList $fields)
This function is used to provide modifications to the form used for front end forms. DataObject->getFrontEndFields()
Caution: Use FieldList->push() to add fields.
updateCMSActions(FieldList $actions)
This is used to provide modifications to the form actions used in the CMS. DataObject->getCMSActions().
updateSummaryFields(array $fields)
this function is used to provide modifications to the summary fields in CMS by the extension By default, the summaryField() of its owner will merge more fields defined in the extension's $extra_fields['summary_fields']
updateFieldLabels(array $labels)
this function is used to provide modifications to the fields labels in CMS by the extension By default, the fieldLabels() of its owner will merge more fields defined in the extension's $extra_fields['field_labels']
static protected mixed
without_fluent_fields(callable $callback)
Executes a callback with extra fluent fields disabled
static array
translated_fields_for($class)
Determines the fields to translate on the given class
static
base_indexes($class)
No description
protected array
getTranslatedTables()
Get all database tables in the class ancestry and their respective translatable fields
static protected array
explode_column_string(string $spec)
Splits a spec string safely, considering quoted columns, whitespace, and cleaning brackets
static protected string
implode_column_list(array $columns)
Builds a properly quoted column list from an array
static protected string
quote_column_spec_string(string $spec)
Given an index specification in the form of a string ensure that each column name is property quoted, stripping brackets and modifiers.
This index may also be in the form of a "CREATE INDEX..." sql fragment
static protected string
determine_index_type(type $spec)
Given an index spec determines the index type
static protected array
parse_index_spec($name, string|array $spec)
Converts an array or string index spec into a universally useful array
static
generate_extra_config(string $class)
Generates the extra DB fields for a class (not including subclasses)
ArrayList
Locales()
Templatable list of all locales
string
LocaleLink(string $locale)
Determine the link to this object given the specified $locale.
Returns null for DataObjects that do not have a 'Link' function.
string
BaseURLForLocale(string $locale = null)
Determine the baseurl within a specified $locale.
ArrayData
LocaleInformation(string $locale = null)
Retrieves information about this object in the specified locale
string
CurrentLocale()
Current locale code
augmentDataQueryCreation(SQLQuery $query, DataQuery $dataQuery)
Amend freshly created DataQuery objects with the current locale and frontend status
static
set_enable_write_augmentation($enabled)
No description
protected array
detectFilterColumn(string $condition, array $includedTables)
Determines the table/column identifier that first appears in the $condition, and returns the localised version of that column.
protected string
localiseFilterCondition(string $condition, array $includedTables, string $locale)
Replaces all columns in the given condition with any localised
protected string
localiseSelect(string $class, string $select, string $fallback)
Generates a select fragment based on a field with a fallback
bool
isFieldNullable(string $field)
Can this field be left empty?
protected $this
addLocaleIndicatorMessage(FieldList $fields)
Adds a UI message to indicate whether you're editing in the default locale or not
MetaTags($tags)
No description
contentcontrollerInit(ContentController $controller)
Ensure that the controller is correctly initialised
updateRelativeLink($base, $action)
No description