View source
<?php
namespace Drupal\photos\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
class PhotosImage extends SqlBase {
public function query() {
$query = $this
->select('photos_image', 'i')
->fields('i', [
'fid',
'pid',
'title',
'des',
'wid',
'count',
'comcount',
'exif',
]);
return $query;
}
public function fields() {
$fields = [
'fid' => $this
->t('File ID'),
'pid' => $this
->t('Photos Album ID'),
'title' => $this
->t('Image title'),
'des' => $this
->t('Image description'),
'wid' => $this
->t('Weight'),
'count' => $this
->t('Image views count'),
'comcount' => $this
->t('Image comment count'),
'exif' => $this
->t('Exif data'),
];
return $fields;
}
public function getIds() {
return [
'fid' => [
'type' => 'integer',
'alias' => 'i',
],
];
}
}