Translation
class Translation extends AnnotationBase (View source)
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().
Properties
| string | $id | The annotated class ID. |
from AnnotationBase |
| protected string | $class | The class used for this annotated class. |
from AnnotationBase |
| protected string | $provider | The provider of the annotated class. |
from AnnotationBase |
| protected TranslatableMarkup | $translation | The string translation object. |
Methods
Sets the name of the provider of the annotated class.
Constructs a new class instance.
Gets the value of an annotation.
Details
string
getProvider()
Gets the name of the provider of the annotated class.
setProvider(string $provider)
Sets the name of the provider of the annotated class.
string
getId()
Gets the unique ID for this annotated class.
string
getClass()
Gets the class of the annotated class.
setClass(string $class)
Sets the class of the annotated class.
__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.
get()
Gets the value of an annotation.