PhotosCount.php in Album Photos 8.5
File
src/Plugin/migrate/source/PhotosCount.php
View source
<?php
namespace Drupal\photos\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
class PhotosCount extends SqlBase {
public function query() {
$query = $this
->select('photos_count', 't')
->fields('t', [
'id',
'cid',
'changed',
'type',
'value',
]);
return $query;
}
public function fields() {
$fields = [
'id' => $this
->t('ID'),
'cid' => $this
->t('CID'),
'changed' => $this
->t('Last updated'),
'type' => $this
->t('Type'),
'value' => $this
->t('Count value'),
];
return $fields;
}
public function getIds() {
return [
'id' => [
'type' => 'integer',
'alias' => 't',
],
];
}
}