Drupal 8  8.0.2
Translation Class Reference
Inheritance diagram for Translation:

Public Member Functions

 __construct (array $values)
 
 get ()
 
- Public Member Functions inherited from AnnotationBase
 getProvider ()
 
 setProvider ($provider)
 
 getId ()
 
 getClass ()
 
 setClass ($class)
 

Protected Attributes

 $translation
 
- Protected Attributes inherited from AnnotationBase
 $class
 
 $provider
 

Additional Inherited Members

- Data Fields inherited from AnnotationBase
 $id
 

Detailed Description

Defines a translatable annotation object.

Some metadata within an annotation needs to be translatable. This class supports that need by allowing both the translatable string and, if specified, a context for that string. The string (with optional context) is passed into t().

Constructor & Destructor Documentation

__construct ( array  $values)

Constructs a new class instance.

Parses values passed into this class through the t() function in Drupal and handles an optional context for the string.

Parameters
array$valuesPossible array keys:
  • value (required): the string that is to be translated.
  • arguments (optional): an array with placeholder replacements, keyed by placeholder.
  • context (optional): a string that describes the context of "value";

References Drupal\translation().

Here is the call graph for this function:

Member Function Documentation

get ( )

{Gets the value of an annotation.}

Implements AnnotationInterface.


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