TractorCow\Fluent\Model\Locale
Synopsis
class Locale
extends DataObject
implements
PermissionProvider
{
- // constants
- const CMS_ACCESS_MULTI_LOCALE = 'CMS_ACCESS_Fluent_Actions_MultiLocale';
- const CMS_ACCESS_FLUENT_LOCALE = "CMS_ACCESS_Fluent_Locale_";
- const X_DEFAULT = 'x-default';
- // members
- private static string $table_name = 'Fluent_Locale';
- private static string $singular_name = 'Locale';
- private static string $plural_name = 'Locales';
- private static array $summary_fields = ;
- private static array $db = ;
- private static string $default_sort = '"Fluent_Locale"."Sort" ASC, "Fluent_Locale"."Locale" ASC';
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $many_many = ;
- protected ArrayList $chain = NULL;
- protected static $locales_by_title;
- // methods
- public string getTitle()
- public string getLongTitle()
- protected string getDefaultTitle()
- public string getLocale()
- public string getDefaultLocale()
- public string getLocaleSuffix()
- public string getBadgeLabel()
- public string getHrefLang()
- public string getURLSegment()
- public void getCMSFields()
- public static Locale getDefault()
- public static Locale getCurrentLocale()
- public static Locale getByLocale()
- public bool isLocale()
- public bool getIsDefault()
- public Domain|null getDomain()
- public bool getIsOnlyLocale()
- public static array getLocales()
- public void onAfterWrite()
- public ArrayList getChain()
- public string getNativeName()
- public string getBaseURL()
- public ArrayList getSiblingLocales()
- public null|RecordLocale RecordLocale()
- public string getLocaleEditPermission()
- public void providePermissions()
- public boolean canView()
- public boolean canEdit()
- public boolean canDelete()
- public boolean canCreate()
- // Inherited methods from CachableModel
- public static array getCached()
- public static void clearCached()
- protected static bool databaseIsReady()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Uses
Implements
- SilverStripe\Security\PermissionProvider
Constants
Name | Value |
---|---|
CMS_ACCESS_MULTI_LOCALE | 'CMS_ACCESS_Fluent_Actions_MultiLocale' |
CMS_ACCESS_FLUENT_LOCALE | "CMS_ACCESS_Fluent_Locale_" |
X_DEFAULT | 'x-default' |
Members
private
- $db — array
- $default_sort
- $has_many
- $has_one — array
- $many_many
- $plural_name
- $singular_name
- $summary_fields
- $table_name
protected
- $chain — SilverStripe\ORM\ArrayList
- $locales_by_title — array
Methods
protected
public
- RecordLocale() — Get details for the current object in this locale.
- canCreate()
- canDelete()
- canEdit()
- canView()
- getBadgeLabel() — Returns the label to display for Fluent badges in the CMS. By default this is the locale's URLSegment as set in /admin/locales, but can be configured with extensions.
- getBaseURL() — Determine the base URL within the current locale
- getByLocale() — Get object by locale code.
- getCMSFields()
- getChain() — Get chain of all locales that should be preferred when this locale is current
- getCurrentLocale() — Get current locale object
- getDefault() — Get default locale
- getDefaultLocale() — Default locale for
- getDomain() — Get domain if in domain mode
- getHrefLang() — RFC 1766 hreflang
- getIsDefault() — Check if this is the default (non-global).
- getIsOnlyLocale() — Determine if this locale is the sole locale on its domain, or globally if domain mode is disabled
- getLocale() — Locale code for this object
- getLocaleEditPermission() — Get permission code to enable access in this locale
- getLocaleSuffix() — Get the locale's country part
- getLocales() — Get available locales
- getLongTitle() — Long title (including locale code)
- getNativeName() — Fetch a native language string from the {@link i18n} class via the current locale code in the format "XX_xx". In the event a match cannot be found in any framework resource, an empty string is returned.
- getSiblingLocales() — Get other locales that appear alongside this (including self)
- getTitle() — Get internal title for this locale
- getURLSegment() — Get URLSegment for this locale
- isLocale() — Returns whether the given locale matches the current Locale object
- onAfterWrite()
- providePermissions()
Inherited from TractorCow\Fluent\Model\CachableModel
protected
- databaseIsReady() — Check if the DB is able to safely query this model