class SourceString in Localization update 7.2
Defines the locale source string object.
This class represents a module-defined string value that is to be translated. This string must at least contain a 'source' field, which is the raw source value, and is assumed to be in English language.
Hierarchy
- class \StringBase implements StringInterface
- class \SourceString
Expanded class hierarchy of SourceString
1 string reference to 'SourceString'
- StringDatabaseStorage::getStrings in includes/
locale/ StringDatabaseStorage.php - Implements StringStorageInterface::getStrings().
File
- includes/
locale/ SourceString.php, line 15 - Definition of SourceString.
View source
class SourceString extends StringBase {
/**
* Implements StringInterface::getParentId().
*/
public function getParentId() {
// Source strings don't have a parent; Translations do.
return 0;
}
/**
* Implements StringInterface::isSource().
*/
public function isSource() {
return isset($this->source);
}
/**
* Implements StringInterface::isTranslation().
*/
public function isTranslation() {
return FALSE;
}
/**
* Implements LocaleString::getString().
*/
public function getString() {
return isset($this->source) ? $this->source : '';
}
/**
* Implements LocaleString::setString().
*/
public function setString($string) {
$this->source = $string;
return $this;
}
/**
* Implements LocaleString::isNew().
*/
public function isNew() {
return empty($this->lid);
}
}