StringInterface

Interface for strings. The plain value of a string is a regular PHP string. For setting the value any PHP variable that casts to a string may be passed. Hierarchy interface \Drupal\Core\TypedData\PrimitiveInterfaceinterface \Drupal\Core\TypedData\Type\StringInterface Related topics Typed Data API API for describing data based on a set of available data types. File core/lib/Drupal/Core/TypedData/Type/StringInterface.php, line 15 Namespace Drupal\Core\TypedData\Type Members Name Mo

StringDatabaseStorage::getTranslations

public StringDatabaseStorage::getTranslations(array $conditions = array(), array $options = array()) Loads multiple string translation objects. Parameters array $conditions: (optional) Array with conditions that will be used to filter the strings returned and may include all of the conditions defined by getStrings(). array $options: (optional) An associative array of additional options. It may contain any of the options defined by getStrings(). Return value \Drupal\locale\StringInterface[] Ar

StringDatabaseStorage::getStrings

public StringDatabaseStorage::getStrings(array $conditions = array(), array $options = array()) Loads multiple source string objects. Parameters array $conditions: (optional) Array with conditions that will be used to filter the strings returned and may include any of the following elements: Any simple field value indexed by field name. 'translated', TRUE to get only translated strings or FALSE to get only untranslated strings. If not set it returns both translated and untranslated strings tha

StringDatabaseStorage::save

public StringDatabaseStorage::save($string) Save string object to storage. Parameters \Drupal\locale\StringInterface $string: The string object. Return value \Drupal\locale\StringStorageInterface The called object. Throws \Drupal\locale\StringStorageException In case of failures, an exception is thrown. Overrides StringStorageInterface::save File core/modules/locale/src/StringDatabaseStorage.php, line 114 Class StringDatabaseStorage Defines a class to store localized strings in the data

StringDatabaseStorage::deleteTranslations

public StringDatabaseStorage::deleteTranslations($conditions) Deletes translations using conditions. Parameters array $conditions: Array with simple field conditions for string translations. Overrides StringStorageInterface::deleteTranslations File core/modules/locale/src/StringDatabaseStorage.php, line 217 Class StringDatabaseStorage Defines a class to store localized strings in the database. Namespace Drupal\locale Code public function deleteTranslations($conditions) { $this->d

StringDatabaseStorage::getLocations

public StringDatabaseStorage::getLocations(array $conditions = array()) Loads string location information. Parameters array $conditions: (optional) Array with conditions to filter the locations that may be any of the following elements: 'sid', The string identifier. 'type', The location type. 'name', The location name. Return value \Drupal\locale\StringInterface[] Array of \Drupal\locale\StringInterface objects matching the conditions. Overrides StringStorageInterface::getLocations See also

StringDatabaseStorage::findTranslation

public StringDatabaseStorage::findTranslation(array $conditions) Loads a string translation object, fast query. This function must only be used when actually translating strings as it will have the effect of updating the string version. For other purposes the getTranslations() method should be used instead. Parameters array $conditions: (optional) Array with conditions that will be used to filter the strings returned and may include all of the conditions defined by getStrings(). Return value

StringDatabaseStorage::findString

public StringDatabaseStorage::findString(array $conditions) Loads a string source object, fast query. These 'fast query' methods are the ones in the critical path and their implementation must be optimized for speed, as they may run many times in a single page request. Parameters array $conditions: (optional) Array with conditions that will be used to filter the strings returned and may include all of the conditions defined by getStrings(). Return value \Drupal\locale\SourceString|null Minima

StringDatabaseStorage::delete

public StringDatabaseStorage::delete($string) Delete string from storage. Parameters \Drupal\locale\StringInterface $string: The string object. Return value \Drupal\locale\StringStorageInterface The called object. Throws \Drupal\locale\StringStorageException In case of failures, an exception is thrown. Overrides StringStorageInterface::delete File core/modules/locale/src/StringDatabaseStorage.php, line 187 Class StringDatabaseStorage Defines a class to store localized strings in the dat

StringDatabaseStorage::dbStringUpdate

protected StringDatabaseStorage::dbStringUpdate($string) Updates string object in the database. Parameters \Drupal\locale\StringInterface $string: The string object. Return value bool|int If the record update failed, returns FALSE. If it succeeded, returns SAVED_NEW or SAVED_UPDATED. Throws \Drupal\locale\StringStorageException If the string is not suitable for this storage, an exception is thrown. File core/modules/locale/src/StringDatabaseStorage.php, line 496 Class StringDatabaseStora