UserPicture.php in Drupal 8
File
core/modules/user/src/Plugin/migrate/source/d6/UserPicture.php
View source
<?php
namespace Drupal\user\Plugin\migrate\source\d6;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
class UserPicture extends DrupalSqlBase {
public function query() {
$query = $this
->select('users', 'u')
->condition('picture', '', '<>')
->fields('u', [
'uid',
'access',
'picture',
])
->orderBy('u.access');
return $query;
}
public function fields() {
return [
'uid' => 'Primary Key: Unique user ID.',
'access' => 'Timestamp for previous time user accessed the site.',
'picture' => "Path to the user's uploaded picture.",
];
}
public function getIds() {
$ids['uid']['type'] = 'integer';
return $ids;
}
}