content_translation_entity_presave

content_translation_entity_presave(EntityInterface $entity) Implements hook_entity_presave(). File core/modules/content_translation/content_translation.module, line 409 Allows entities to be translated into different languages. Code function content_translation_entity_presave(EntityInterface $entity) { if ($entity instanceof ContentEntityInterface && $entity->isTranslatable() && !$entity->isNew()) { // If we are creating a new translation we need to use the source

AttachedAssetsInterface::setLibraries

public AttachedAssetsInterface::setLibraries(array $libraries) Sets the asset libraries attached to the current response. Parameters string[] $libraries: A list of libraries, in the order they should be loaded. Return value $this File core/lib/Drupal/Core/Asset/AttachedAssetsInterface.php, line 38 Class AttachedAssetsInterface The attached assets collection for the current response. Namespace Drupal\Core\Asset Code public function setLibraries(array $libraries);

NestedArray::keyExists

public static NestedArray::keyExists(array $array, array $parents) Determines whether a nested array contains the requested keys. This helper function should be used when the depth of the array element to be checked may vary (that is, the number of parent keys is variable). See NestedArray::setValue() for details. It is primarily used for form structures and renderable arrays. If it is required to also get the value of the checked nested key, use NestedArray::getValue() instead. If the number o

Datelist::validateDatelist

public static Datelist::validateDatelist(&$element, FormStateInterface $form_state, &$complete_form) Validation callback for a datelist element. If the date is valid, the date object created from the user input is set in the form for use by the caller. The work of compiling the user input back into a date object is handled by the value callback, so we can use it here. We also have the raw input available for validation testing. Parameters array $element: The element being processed. \D

PhpTransliteration::__construct

public PhpTransliteration::__construct($data_directory = NULL) Constructs a transliteration object. Parameters string $data_directory: (optional) The directory where data files reside. If omitted, defaults to subdirectory 'data' underneath the directory where the class's PHP file resides. File core/lib/Drupal/Component/Transliteration/PhpTransliteration.php, line 69 Class PhpTransliteration Implements transliteration without using the PECL extensions. Namespace Drupal\Component\Transli

PhpTransliteration::removeDiacritics

public PhpTransliteration::removeDiacritics($string) Removes diacritics (accents) from certain letters. This only applies to certain letters: Accented Latin characters like a-with-acute-accent, in the UTF-8 character range of 0xE0 to 0xE6 and 01CD to 024F. Replacements that would result in the string changing length are excluded, as well as characters that are not accented US-ASCII letters. Parameters string $string: The string holding diacritics. Return value string $string with accented let

VariantInterface::label

public VariantInterface::label() Returns the user-facing display variant label. Return value string The display variant label. File core/lib/Drupal/Core/Display/VariantInterface.php, line 27 Class VariantInterface Provides an interface for DisplayVariant plugins. Namespace Drupal\Core\Display Code public function label();

FieldStorageAddForm::validateAddExisting

protected FieldStorageAddForm::validateAddExisting(array $form, FormStateInterface $form_state) Validates the 're-use existing field' case. Parameters array $form: An associative array containing the structure of the form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. See also \Drupal\field_ui\Form\FieldStorageAddForm::validateForm() File core/modules/field_ui/src/Form/FieldStorageAddForm.php, line 290 Class FieldStorageAddForm Provides a form for the "

ImageStyleEditForm::actions

public ImageStyleEditForm::actions(array $form, FormStateInterface $form_state) Returns an array of supported actions for the current entity form. @todo Consider introducing a 'preview' action here, since it is used by many entity types. Overrides EntityForm::actions File core/modules/image/src/Form/ImageStyleEditForm.php, line 260 Class ImageStyleEditForm Controller for image style edit form. Namespace Drupal\image\Form Code public function actions(array $form, FormStateInterface $for

BlockContent::preSaveRevision

public BlockContent::preSaveRevision(EntityStorageInterface $storage, \stdClass $record) Acts on a revision before it gets saved. Parameters EntityStorageInterface $storage: The entity storage object. \stdClass $record: The revision object. Overrides ContentEntityBase::preSaveRevision File core/modules/block_content/src/Entity/BlockContent.php, line 129 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code public function preSaveRevision(