StringBase::setPlurals

public StringBase::setPlurals($plurals) Sets this string using array of plural values. Serializes plural variants in one string glued by LOCALE_PLURAL_DELIMITER. Parameters array $plurals: Array of strings with plural variants. Return value $this Overrides StringInterface::setPlurals File core/modules/locale/src/StringBase.php, line 104 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public function setPlurals($plurals) { $this->setString(impl

StringBase::getVersion

public StringBase::getVersion() Gets the string version. Return value string Version identifier. Overrides StringInterface::getVersion File core/modules/locale/src/StringBase.php, line 82 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public function getVersion() { return isset($this->version) ? $this->version : NULL; }

StringBase::hasLocation

public StringBase::hasLocation($type, $name) Checks whether the string has a given location. Parameters string $type: Location type. string $name: Location name. Return value bool TRUE if the string has a location with this type and name. Overrides StringInterface::hasLocation File core/modules/locale/src/StringBase.php, line 173 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public function hasLocation($type, $name) { $locations = $this->get

StringBase::save

public StringBase::save() Saves string object to storage. Return value $this Throws \Drupal\locale\StringStorageException In case of failures, an exception is thrown. Overrides StringInterface::save File core/modules/locale/src/StringBase.php, line 181 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public function save() { if ($storage = $this->getStorage()) { $storage->save($this); } else { throw new StringStorageException('Th

StringBase::getValues

public StringBase::getValues(array $fields) Gets field values that are set for given field names. Parameters array $fields: Array of field names. Return value array Array of field values indexed by field name. Overrides StringInterface::getValues File core/modules/locale/src/StringBase.php, line 139 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public function getValues(array $fields) { $values = array(); foreach ($fields as $field) { if

StringBase::getStorage

public StringBase::getStorage() Gets the string storage. Return value \Drupal\locale\StringStorageInterface The storage used for this string. Overrides StringInterface::getStorage File core/modules/locale/src/StringBase.php, line 112 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public function getStorage() { return isset($this->storage) ? $this->storage : NULL; }

StringBase::addLocation

public StringBase::addLocation($type, $name) Adds a location for this string. Parameters string $type: Location type that may be any arbitrary string. Types used in Drupal core are: 'javascript', 'path', 'code', 'configuration'. string $name: Location name. Drupal path in case of online discovered translations, file path in case of imported strings, configuration name for strings that come from configuration, etc. Return value $this Overrides StringInterface::addLocation File core/modules/loc

StringBase::getLocations

public StringBase::getLocations($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. Parameters bool $check_only: (optional) Set to TRUE to get only new locations

StringBase::$version

The string version. Type: string File core/modules/locale/src/StringBase.php, line 45 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public $version;

StringBase::getPlurals

public StringBase::getPlurals() Splits string to work with plural values. Return value array Array of strings that are plural variants. Overrides StringInterface::getPlurals File core/modules/locale/src/StringBase.php, line 97 Class StringBase Defines the locale string base class. Namespace Drupal\locale Code public function getPlurals() { return explode(LOCALE_PLURAL_DELIMITER, $this->getString()); }