StringInterface
interface StringInterface (View source)
Defines the locale string interface.
Methods
Gets the string unique identifier.
Sets the string unique identifier.
Gets the string version.
Sets the string version.
Gets plain string contained in this object.
Sets the string contained in this object.
Splits string to work with plural values.
Sets this string using array of plural values.
Gets the string storage.
Checks whether the object is not saved to storage yet.
Checks whether the object is a source string.
Checks whether the object is a translation string.
Sets an array of values as object properties.
Gets field values that are set for given field names.
Gets location information for this string.
Adds a location for this string.
Checks whether the string has a given location.
Saves string object to storage.
Deletes string object from storage.
Details
int
getId()
Gets the string unique identifier.
$this
setId(int $id)
Sets the string unique identifier.
string
getVersion()
Gets the string version.
$this
setVersion(string $version)
Sets the string version.
string
getString()
Gets plain string contained in this object.
$this
setString(string $string)
Sets the string contained in this object.
array
getPlurals()
Splits string to work with plural values.
$this
setPlurals(array $plurals)
Sets this string using array of plural values.
Serializes plural variants in one string glued by \Drupal\Component\Gettext\PoItem::DELIMITER.
StringStorageInterface
getStorage()
Gets the string storage.
$this
setStorage(StringStorageInterface $storage)
Sets the string storage.
bool
isNew()
Checks whether the object is not saved to storage yet.
bool
isSource()
Checks whether the object is a source string.
bool
isTranslation()
Checks whether the object is a translation string.
$this
setValues(array $values, bool $override = TRUE)
Sets an array of values as object properties.
array
getValues(array $fields)
Gets field values that are set for given field names.
array
getLocations(bool $check_only = FALSE)
Gets location information for this string.
Locations are arbitrary pairs of type and name strings, used to store information about the origins of the string, like the file name it was found on, the path on which it was discovered, etc.
A string can have any number of locations since the same string may be found on different places of Drupal code and configuration.
$this
addLocation(string $type, string $name)
Adds a location for this string.
bool
hasLocation(string $type, string $name)
Checks whether the string has a given location.
$this
save()
Saves string object to storage.
$this
delete()
Deletes string object from storage.