EckEntityTranslation.php in Entity Construction Kit (ECK) 8
File
src/Plugin/migrate/source/d7/EckEntityTranslation.php
View source
<?php
namespace Drupal\eck\Plugin\migrate\source\d7;
class EckEntityTranslation extends EckEntity {
public function query() {
$query = parent::query();
$query
->innerJoin('entity_translation', 'et', 'et.entity_id = eck.id');
$query
->fields('et');
$query
->condition('et.entity_type', $this->entityType);
$query
->condition('et.source', '', '<>');
$query
->orderBy('et.revision_id');
$query
->orderBy('et.language');
return $query;
}
public function fields() {
return parent::fields() + [
'entity_type' => $this
->t('Entity translation entity type.'),
'entity_id' => $this
->t('Entity translation entity ID.'),
'revision_id' => $this
->t('Entity translation revision ID.'),
'source' => $this
->t('Entity translation source language code.'),
'uid' => $this
->t('The author of this translation.'),
'status' => $this
->t('Boolean indicating whether the translation is published (visible to non-administrators).'),
'translate' => $this
->t('A boolean indicating whether this translation needs to be updated.'),
'created' => $this
->t('The Unix timestamp when the translation was created.'),
'changed' => $this
->t('The Unix timestamp when the translation was most recently saved.'),
];
}
public function getIds() {
return parent::getIds() + [
'language' => [
'type' => 'string',
'alias' => 'et',
],
];
}
}