Default controller class for source plugins.
Expanded class hierarchy of SourcePluginBase
abstract class SourcePluginBase extends PluginBase implements SourcePluginInterface {
/**
* {@inheritdoc}
*/
public function getLabel(JobItemInterface $job_item) {
return t('@plugin item unavailable (@item)', array(
'@plugin' => $this->pluginDefinition['label'],
'@item' => $job_item
->getItemType() . ':' . $job_item
->getItemId(),
));
}
/**
* {@inheritdoc}
*/
public function getUrl(JobItemInterface $job_item) {
return NULL;
}
/**
* {@inheritdoc}
*/
public function getItemTypes() {
return isset($this->pluginDefinition['item types']) ? $this->pluginDefinition['item types'] : array();
}
/**
* {@inheritdoc}
*/
public function getItemTypeLabel($type) {
$types = $this
->getItemTypes();
if (isset($types[$type])) {
return $types[$type];
}
return '';
}
/**
* {@inheritdoc}
*/
public function getType(JobItemInterface $job_item) {
return ucfirst($job_item
->getItemType());
}
/**
* {@inheritdoc}
*/
public function getExistingLangCodes(JobItemInterface $job_item) {
return [
$this
->getSourceLangCode($job_item),
];
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SourcePluginBase:: |
public | function |
Return a title for this job item. Overrides SourcePluginInterface:: |
4 |
SourcePluginBase:: |
public | function |
Returns the Uri for this job item. Overrides SourcePluginInterface:: |
3 |
SourcePluginBase:: |
public | function |
Returns an array of translatable source item types. Overrides SourcePluginInterface:: |
3 |
SourcePluginBase:: |
public | function |
Returns the label of a source item type. Overrides SourcePluginInterface:: |
2 |
SourcePluginBase:: |
public | function |
Returns the type of a job item. Overrides SourcePluginInterface:: |
3 |
SourcePluginBase:: |
public | function |
Gets existing translation language codes of the job item source. Overrides SourcePluginInterface:: |
4 |
SourcePluginInterface:: |
public | function | Returns an array with the data structured for translation. | 4 |
SourcePluginInterface:: |
public | function | Saves a translation. | 4 |
SourcePluginInterface:: |
public | function | Gets language code of the job item source. | 4 |