Drupal 8  8.0.2
ContentLanguageSettings Class Reference
Inheritance diagram for ContentLanguageSettings:

Public Member Functions

 __construct (array $values, $entity_type= 'language_content_settings')
 
 id ()
 
 getTargetEntityTypeId ()
 
 getTargetBundle ()
 
 setTargetBundle ($target_bundle)
 
 setDefaultLangcode ($default_langcode)
 
 getDefaultLangcode ()
 
 setLanguageAlterable ($language_alterable)
 
 isLanguageAlterable ()
 
 preSave (EntityStorageInterface $storage)
 
 isDefaultConfiguration ()
 
 calculateDependencies ()
 
- 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 loadByEntityTypeBundle ($entity_type_id, $bundle)
 
- 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())
 

Protected Attributes

 $id
 
 $target_entity_type_id
 
 $target_bundle
 
 $default_langcode = LanguageInterface::LANGCODE_SITE_DEFAULT
 
 $language_alterable = FALSE
 
- 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

- 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)
 
- 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)
 

Detailed Description

Defines the ContentLanguageSettings entity.

( id = "language_content_settings", label = ("Content Language Settings"), admin_permission = "administer languages", config_prefix = "content_settings", entity_keys = { "id" = "id" }, )

Constructor & Destructor Documentation

__construct ( array  $values,
  $entity_type = 'language_content_settings' 
)

Constructs a ContentLanguageSettings object.

In most cases, Field entities are created via entity_create('field_config', $values), where $values is the same parameter as in this constructor.

Parameters
array$valuesAn array of the referring entity bundle with:
  • target_entity_type_id: The entity type.
  • target_bundle: The bundle. Other array elements will be used to set the corresponding properties on the class; see the class property documentation for details.
See Also
entity_create()

Member Function Documentation

calculateDependencies ( )

{Calculates dependencies and stores them in the dependency property.

Returns
$this
See Also
}

Implements ConfigEntityInterface.

References ConfigEntityBase\addDependency(), and Drupal\entityManager().

Here is the call graph for this function:

getDefaultLangcode ( )

{Gets the default language code.

Returns
string
}

Implements ContentLanguageSettingsInterface.

Referenced by ContentLanguageSettingsUnitTest\testDefaultLangcode().

Here is the caller graph for this function:

getTargetBundle ( )

{Gets the bundle this config applies to.

Returns
string
}

Implements ContentLanguageSettingsInterface.

getTargetEntityTypeId ( )

{Gets the entity type ID this config applies to.

Returns
string
}

Implements ContentLanguageSettingsInterface.

id ( )

{Gets the identifier.

Returns
string|int|null The entity identifier, or NULL if the object does not yet have an identifier.
}

Implements EntityInterface.

Referenced by ContentLanguageSettings\preSave().

Here is the caller graph for this function:

isDefaultConfiguration ( )

{Checks if this config object contains the default values in every property.

Returns
bool True if all the properties contain the default values. False otherwise.
}

Implements ContentLanguageSettingsInterface.

References LanguageInterface\LANGCODE_SITE_DEFAULT.

Referenced by ContentLanguageSettingsUnitTest\testIsDefaultConfiguration().

Here is the caller graph for this function:

isLanguageAlterable ( )

{Checks if the language is alterable or not.

Returns
bool
}

Implements ContentLanguageSettingsInterface.

Referenced by ContentLanguageSettingsUnitTest\testLanguageAlterable().

Here is the caller graph for this function:

static loadByEntityTypeBundle (   $entity_type_id,
  $bundle 
)
static

Loads a content language config entity based on the entity type and bundle.

Parameters
string$entity_type_idID of the entity type.
string$bundleBundle name.
Returns
$this The content language config entity if one exists. Otherwise, returns default values.

References Entity\create(), and Drupal\entityManager().

Referenced by LanguageConfigurationElement\buildForm(), ContentLanguageSettingsForm\buildForm(), EntityDefaultLanguageTest\createContentType(), BlockContentTypeForm\form(), VocabularyForm\form(), NodeTypeForm\form(), CommentTypeForm\form(), ContentLanguageSettingsForm\submitForm(), LanguageConfigurationElementTest\testDefaultLangcode(), LanguageConfigurationElementTest\testLanguageConfigurationElement(), ContentLanguageSettingsUnitTest\testLoadByEntityTypeBundle(), MenuLanguageTest\testMenuLanguage(), LanguageConfigurationElementTest\testNodeTypeUpdate(), ContentTranslationSettingsTest\testSettingsUI(), LanguageConfigurationElementTest\testTaxonomyVocabularyUpdate(), and VocabularyLanguageTest\testVocabularyDefaultLanguageForTerms().

Here is the call graph for this function:

Here is the caller graph for this function:

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 ContentLanguageSettings\id().

Here is the call graph for this function:

setDefaultLangcode (   $default_langcode)

{Sets the default language code.

Parameters
string$default_langcodeThe default language code.
Returns
$this;
}

Implements ContentLanguageSettingsInterface.

setLanguageAlterable (   $language_alterable)

{Sets if the language must be alterable or not.

Parameters
bool$language_alterableFlag indicating if the language must be alterable.
Returns
$this
}

Implements ContentLanguageSettingsInterface.

setTargetBundle (   $target_bundle)

{Sets the bundle this config applies to.

Parameters
string$target_bundleThe bundle.
Returns
$this
}

Implements ContentLanguageSettingsInterface.


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