Drupal 8  8.0.2
ConfigurableLanguage Class Reference
Inheritance diagram for ConfigurableLanguage:

Public Member Functions

 isDefault ()
 
 isLocked ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 getName ()
 
 setName ($name)
 
 getId ()
 
 getDirection ()
 
 getWeight ()
 
 setWeight ($weight)
 
- Public Member Functions inherited from ConfigEntityBase
 __construct (array $values, $entity_type)
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 isNew ()
 
 get ($property_name)
 
 set ($property_name, $value)
 
 enable ()
 
 disable ()
 
 setStatus ($status)
 
 status ()
 
 setSyncing ($syncing)
 
 isSyncing ()
 
 setUninstalling ($uninstalling)
 
 isUninstalling ()
 
 createDuplicate ()
 
 preSave (EntityStorageInterface $storage)
 
 calculateDependencies ()
 
 urlInfo ($rel= 'edit-form', array $options=[])
 
 url ($rel= 'edit-form', $options=array())
 
 link ($text=NULL, $rel= 'edit-form', array $options=[])
 
 toUrl ($rel= 'edit-form', array $options=[])
 
 getCacheTagsToInvalidate ()
 
 getDependencies ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
 onDependencyRemoval (array $dependencies)
 
 setThirdPartySetting ($module, $key, $value)
 
 getThirdPartySetting ($module, $key, $default=NULL)
 
 getThirdPartySettings ($module)
 
 unsetThirdPartySetting ($module, $key)
 
 getThirdPartyProviders ()
 
 isInstallable ()
 
 trustData ()
 
 hasTrustedData ()
 
 save ()
 
- Public Member Functions inherited from Entity
 __construct (array $values, $entity_type)
 
 id ()
 
 uuid ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=[])
 
 toUrl ($rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($rel)
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 url ($rel= 'canonical', $options=array())
 
 uriRelationships ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 save ()
 
 delete ()
 
 createDuplicate ()
 
 getEntityType ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 referencedEntities ()
 
 getCacheContexts ()
 
 getCacheTagsToInvalidate ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 __sleep ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 

Static Public Member Functions

static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static createFromLangcode ($langcode)
 
- Static Public Member Functions inherited from ConfigEntityBase
static sort (ConfigEntityInterface $a, ConfigEntityInterface $b)
 
- Static Public Member Functions inherited from Entity
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 

Static Protected Member Functions

static getDefaultLangcode ()
 
- Static Protected Member Functions inherited from ConfigEntityBase
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 
static getConfigManager ()
 
- Static Protected Member Functions inherited from Entity
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 

Protected Attributes

 $id
 
 $label
 
 $direction = self::DIRECTION_LTR
 
 $weight = 0
 
 $locked = FALSE
 
 $preSaveMultilingual
 
- Protected Attributes inherited from ConfigEntityBase
 $originalId
 
 $pluginConfigKey
 
 $status = TRUE
 
 $uuid
 
 $langcode = 'en'
 
 $third_party_settings = array()
 
 $_core = []
 
 $trustedData = FALSE
 
- Protected Attributes inherited from Entity
 $entityTypeId
 
 $enforceIsNew
 
 $typedData
 

Additional Inherited Members

- Data Fields inherited from LanguageInterface
const LANGCODE_SYSTEM = 'system'
 
const LANGCODE_NOT_SPECIFIED = 'und'
 
const LANGCODE_NOT_APPLICABLE = 'zxx'
 
const LANGCODE_DEFAULT = 'x-default'
 
const LANGCODE_SITE_DEFAULT = 'site_default'
 
const STATE_CONFIGURABLE = 1
 
const STATE_LOCKED = 2
 
const STATE_ALL = 3
 
const STATE_SITE_DEFAULT = 4
 
const TYPE_CONTENT = 'language_content'
 
const TYPE_INTERFACE = 'language_interface'
 
const TYPE_URL = 'language_url'
 
const DIRECTION_LTR = 'ltr'
 
const DIRECTION_RTL = 'rtl'
 
- Protected Member Functions inherited from ConfigEntityBase
 getTypedConfig ()
 
 addDependency ($type, $name)
 
 invalidateTagsOnSave ($update)
 
- Protected Member Functions inherited from Entity
 entityManager ()
 
 entityTypeManager ()
 
 languageManager ()
 
 uuidGenerator ()
 
 linkTemplates ()
 
 urlRouteParameters ($rel)
 
 invalidateTagsOnSave ($update)
 

Detailed Description

Defines the ConfigurableLanguage entity.

( id = "configurable_language", label = ("Language"), handlers = { "list_builder" = "Drupal\language\LanguageListBuilder", "access" = "Drupal\language\LanguageAccessControlHandler", "form" = { "add" = "Drupal\language\Form\LanguageAddForm", "edit" = "Drupal\language\Form\LanguageEditForm", "delete" = "Drupal\language\Form\LanguageDeleteForm" } }, admin_permission = "administer languages", config_prefix = "entity", entity_keys = { "id" = "id", "label" = "label", "weight" = "weight" }, links = { "delete-form" = "/admin/config/regional/language/delete/{configurable_language}", "edit-form" = "/admin/config/regional/language/edit/{configurable_language}", "collection" = "/admin/config/regional/language", } )

Member Function Documentation

static createFromLangcode (   $langcode)
static

Creates a configurable language object from a langcode.

Parameters
string$langcodeThe language code to use to create the object.
Returns
$this
See Also
::getStandardLanguageList()

References LanguageManager\getStandardLanguageList().

Referenced by CKEditorTest\assertCKEditorLanguage(), ConfigTranslationListUiTest\doLanguageListTest(), LanguageFallbackTest\setUp(), ContentEntityCloneTest\setUp(), EntityRevisionTranslationTest\setUp(), ConfigEntityListMultilingualTest\setUp(), LocaleLocaleLookupTest\setUp(), LocaleTranslatedSchemaDefinitionTest\setUp(), TranslationStringTest\setUp(), UserTokenReplaceTest\setUp(), LocaleStringTest\setUp(), BlockContentFieldFilterTest\setUp(), ContentEntityChangedTest\setUp(), NodeLanguageTest\setUp(), BulkFormTest\setUp(), NodeRevisionsTest\setUp(), QueryGroupByTest\setUp(), RowEntityRenderersTest\setUp(), LocaleConfigSubscriberForeignTest\setUpLanguages(), LocaleConfigSubscriberTest\setUpLanguages(), ContentTranslationTestBase\setupLanguages(), EntityReferenceFieldTranslatedReferenceViewTest\setUpLanguages(), ImportForm\submitForm(), ConfigLanguageOverrideTest\testConfigLanguageOverride(), LanguageConfigOverrideImportTest\testConfigOverrideImport(), LanguageConfigOverrideImportTest\testConfigOverrideImportEvents(), LocaleConfigTranslationImportTest\testConfigTranslationImport(), WizardPluginBaseKernelTest\testCreateView(), LanguageDependencyInjectionTest\testDependencyInjectedNewDefaultLanguage(), StorageTest\testDetails(), ContextualDynamicContextTest\testDifferentPermissions(), ViewEditTest\testEditFormLanguageOptions(), LocaleConfigSubscriberForeignTest\testEnglish(), UpcastingTest\testEntityLanguage(), LocaleConfigManagerTest\testGetDefaultConfigLangcode(), LocaleConfigManagerTest\testGetStringTranslation(), LocaleConfigManagerTest\testHasTranslation(), LanguageConfigOverrideInstallTest\testLanguageConfigOverrideInstall(), LanguageConfigurationTest\testLanguageConfiguration(), LanguageUILanguageNegotiationTest\testLanguageDomain(), ToolbarAdminMenuTest\testLanguageSwitching(), BasicAuthTest\testLocale(), UserLanguageCreationTest\testLocalUserCreation(), SearchMultilingualTest\testMultilingualSearchFilter(), PagerTest\testPagerConfigTranslation(), PagerTest\testPagerLocale(), ConfigInstallWebTest\testPreExistingConfigInstall(), TourTest\testTourFunctionality(), DisplayTest\testTranslationSetting(), LocaleTranslationUiTest\testUICustomizedStrings(), LanguageUILanguageNegotiationTest\testUILanguageNegotiation(), LanguageUILanguageNegotiationTest\testUrlLanguageFallback(), NodeViewLanguageTest\testViewLanguage(), ViewNonTranslatableEntityTest\testViewNoTranslatableEntity(), and ViewsUITourTest\testViewsUiTourTipsTranslated().

Here is the call graph for this function:

static getDefaultLangcode ( )
staticprotected

Gets the default langcode.

Returns
string The current default langcode.

References Drupal\service().

Here is the call graph for this function:

getDirection ( )

{Gets the text direction (left-to-right or right-to-left).

Returns
string Either self::DIRECTION_LTR or self::DIRECTION_RTL.
}

Implements LanguageInterface.

getId ( )

{Gets the ID (language code).

Returns
string The language code.
}

Implements LanguageInterface.

References Entity\id().

Here is the call graph for this function:

getName ( )

{Gets the name of the language.

Returns
string The human-readable name of the language (in the language that was used to construct this object).
}

Implements LanguageInterface.

References Entity\label().

Here is the call graph for this function:

getWeight ( )

{Gets the weight of the language.

Returns
int The weight, used to order languages with larger positive weights sinking items toward the bottom of lists.
}

Implements LanguageInterface.

isDefault ( )

{Returns whether this language is the default language.

Returns
bool Whether the language is the default language.
}

Implements LanguageInterface.

References Entity\id().

Here is the call graph for this function:

isLocked ( )

{Returns whether this language is locked.

Returns
bool Whether the language is locked or not.
}

Implements LanguageInterface.

Referenced by ConfigurableLanguage\postSave().

Here is the caller graph for this function:

static postDelete ( EntityStorageInterface  $storage,
array  $entities 
)
static

{Acts on deleted entities before the delete hook is invoked.Used after the entities are deleted but before invoking the delete hook.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
\Drupal\Core\Entity\EntityInterface[]$entities An array of entities.
}

Implements EntityInterface.

References Drupal\languageManager(), and ConfigurableLanguageManager\rebuildServices().

Here is the call graph for this function:

postSave ( EntityStorageInterface  $storage,
  $update = TRUE 
)

{Acts on a saved entity before the insert or update hook is invoked.Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
bool$updateTRUE if the entity has been updated, or FALSE if it has been inserted.
}

Implements EntityInterface.

References ConfigurableLanguage\isLocked(), ConfigEntityBase\isSyncing(), Drupal\languageManager(), and Drupal\service().

Here is the call graph for this function:

static preDelete ( EntityStorageInterface  $storage,
array  $entities 
)
static

{Acts on entities before they are deleted and before hooks are invoked.Used before the entities are deleted and before invoking the delete hook.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
\Drupal\Core\Entity\EntityInterface[]$entities An array of entities.
}

Exceptions
\DeleteDefaultLanguageExceptionException thrown if we're trying to delete the default language entity. This is not allowed as a site must have a default language.

Implements EntityInterface.

preSave ( EntityStorageInterface  $storage)

{Acts on an entity before the presave hook is invoked.Used before the entity is saved and before invoking the presave hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed. This is different from its counterpart in the Field API, FieldItemListInterface::preSave(), which is fired on all field translations automatically.

Todo:
Adjust existing implementations and the documentation according to https://www.drupal.org/node/2577609 to have a consistent API.
Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
See Also
::preSave()
}

Implements EntityInterface.

References Drupal\languageManager().

Here is the call graph for this function:

setName (   $name)

{Sets the name of the language.

Parameters
string$nameThe human-readable English name of the language.
Returns
$this
}

Implements ConfigurableLanguageInterface.

References Entity\label().

Here is the call graph for this function:

setWeight (   $weight)

{Sets the weight of the language.

Parameters
int$weightThe weight, used to order languages with larger positive weights sinking items toward the bottom of lists.
Returns
$this
}

Implements ConfigurableLanguageInterface.


The documentation for this class was generated from the following file: