Drupal 8  8.0.2
TranslationString Class Reference
Inheritance diagram for TranslationString:

Public Member Functions

 __construct ($values=array())
 
 setCustomized ($customized=TRUE)
 
 isSource ()
 
 isTranslation ()
 
 getString ()
 
 setString ($string)
 
 isNew ()
 
 save ()
 
 delete ()
 
- Public Member Functions inherited from StringBase
 __construct ($values=array())
 
 getId ()
 
 setId ($lid)
 
 getVersion ()
 
 setVersion ($version)
 
 getPlurals ()
 
 setPlurals ($plurals)
 
 getStorage ()
 
 setStorage ($storage)
 
 setValues (array $values, $override=TRUE)
 
 getValues (array $fields)
 
 getLocations ($check_only=FALSE)
 
 addLocation ($type, $name)
 
 hasLocation ($type, $name)
 
 save ()
 
 delete ()
 

Data Fields

 $language
 
 $translation
 
 $customized
 
- Data Fields inherited from StringBase
 $lid
 
 $locations
 
 $source
 
 $context
 
 $version
 

Protected Attributes

 $isNew
 
- Protected Attributes inherited from StringBase
 $storage
 

Detailed Description

Defines the locale translation string object.

This class represents a translation of a source string to a given language, thus it must have at least a 'language' which is the language code and a 'translation' property which is the translated text of the source string in the specified language.

Constructor & Destructor Documentation

__construct (   $values = array())

{}

References TranslationString\isNew(), and TranslationString\isTranslation().

Here is the call graph for this function:

Member Function Documentation

delete ( )

{Deletes string object from storage.

Returns
$this
Exceptions
\Drupal\locale\StringStorageExceptionIn case of failures, an exception is thrown.
}

Implements StringInterface.

References TranslationString\isNew().

Here is the call graph for this function:

getString ( )

{Gets plain string contained in this object.

Returns
string The string contained in this object.
}

Implements StringInterface.

References Drupal\translation().

Here is the call graph for this function:

isNew ( )

{Checks whether the object is not saved to storage yet.

Returns
bool TRUE if the object exists in the storage, FALSE otherwise.
}

Implements StringInterface.

Referenced by TranslationString\__construct(), TranslationString\delete(), and TranslationString\save().

Here is the caller graph for this function:

isSource ( )

{Checks whether the object is a source string.

Returns
bool TRUE if the object is a source string, FALSE otherwise.
}

Implements StringInterface.

isTranslation ( )

{Checks whether the object is a translation string.

Returns
bool TRUE if the object is a translation string, FALSE otherwise.
}

Implements StringInterface.

References Drupal\translation().

Referenced by TranslationString\__construct().

Here is the call graph for this function:

Here is the caller graph for this function:

save ( )

{Saves string object to storage.

Returns
$this
Exceptions
\Drupal\locale\StringStorageExceptionIn case of failures, an exception is thrown.
}

Implements StringInterface.

References TranslationString\isNew().

Here is the call graph for this function:

setCustomized (   $customized = TRUE)

Sets the string as customized / not customized.

Parameters
bool$customized(optional) Whether the string is customized or not. Defaults to TRUE.
Returns
The called object.
setString (   $string)

{Sets the string contained in this object.

Parameters
string$stringString to set as value.
Returns
$this
}

Implements StringInterface.

References Drupal\translation().

Here is the call graph for this function:


The documentation for this class was generated from the following file: