Test source plugin implementation.
@SourcePlugin(
id = "test_html_source",
label = @Translation("Test HTML source"),
description = @Translation("HTML source for testing purposes.")
)
Expanded class hierarchy of TestHtmlSource
class TestHtmlSource extends TestSource {
/**
* {@inheritdoc}
*/
public function getData(JobItemInterface $job_item) {
return array(
'dummy' => array(
'deep_nesting' => array(
'#text' => file_get_contents(\Drupal::service('extension.list.module')
->getPath('tmgmt') . '/tests/testing_html/sample.html'),
'#label' => 'Label for job item with type ' . $job_item
->getItemType() . ' and id ' . $job_item
->getItemId() . '.',
),
),
);
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SourcePluginBase:: |
public | function |
Returns the label of a source item type. Overrides SourcePluginInterface:: |
2 |
SourcePluginBase:: |
public | function |
Returns an array of translatable source item types. Overrides SourcePluginInterface:: |
3 |
SourcePluginBase:: |
public | function |
Returns the type of a job item. Overrides SourcePluginInterface:: |
3 |
TestHtmlSource:: |
public | function |
Returns an array with the data structured for translation. Overrides TestSource:: |
|
TestSource:: |
public | function |
Gets existing translation language codes of the job item source. Overrides SourcePluginBase:: |
|
TestSource:: |
public | function |
Return a title for this job item. Overrides SourcePluginBase:: |
|
TestSource:: |
public | function |
Gets language code of the job item source. Overrides SourcePluginInterface:: |
|
TestSource:: |
public | function |
Returns the Uri for this job item. Overrides SourcePluginBase:: |
|
TestSource:: |
protected | function | Will replace placeholders in the #text offsets. | |
TestSource:: |
public | function |
Saves a translation. Overrides SourcePluginInterface:: |