Error message

  • Warning: count(): Parameter must be an array or an object that implements Countable in _api_make_match_member_link() (line 1230 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Warning: count(): Parameter must be an array or an object that implements Countable in _api_make_match_member_link() (line 1230 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

public function TestHtmlSource::getData

Returns an array with the data structured for translation.

Parameters

\Drupal\tmgmt\JobItemInterface $job_item: The job item entity.

Overrides TestSource::getData

See also

JobItem::getData()

File

tmgmt_test/src/Plugin/tmgmt/Source/TestHtmlSource.php, line 21

Class

TestHtmlSource
Test source plugin implementation.

Namespace

Drupal\tmgmt_test\Plugin\tmgmt\Source

Code

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() . '.',
      ),
    ),
  );
}