Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / user / src / Plugin / migrate / source / UserPictureInstance.php
1 <?php
2
3 namespace Drupal\user\Plugin\migrate\source;
4
5 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
6 use Drupal\migrate\Plugin\migrate\source\DummyQueryTrait;
7
8 /**
9  * User picture field instance source.
10  *
11  * @todo Support default picture?
12  *
13  * @MigrateSource(
14  *   id = "user_picture_instance",
15  *   source_module = "user"
16  * )
17  */
18 class UserPictureInstance extends DrupalSqlBase {
19
20   use DummyQueryTrait;
21
22   /**
23    * {@inheritdoc}
24    */
25   public function initializeIterator() {
26     return new \ArrayIterator([
27       [
28         'id' => '',
29         'file_directory' => $this->variableGet('user_picture_path', 'pictures'),
30         'max_filesize' => $this->variableGet('user_picture_file_size', '30') . 'KB',
31         'max_resolution' => $this->variableGet('user_picture_dimensions', '85x85'),
32       ],
33     ]);
34   }
35
36   /**
37    * {@inheritdoc}
38    */
39   public function fields() {
40     return [
41       'file_directory' => 'The directory to store images..',
42       'max_filesize' => 'The maximum allowed file size in KBs.',
43       'max_resolution' => "The maximum resolution.",
44     ];
45   }
46
47   /**
48    * {@inheritdoc}
49    */
50   public function getIds() {
51     $ids['id']['type'] = 'string';
52     return $ids;
53   }
54
55 }