initialParse($configuration)); $records = array_filter($rawRecords, [$this, 'filter01']); $this->records = $records; } /** * Flatten the field hierarchy. Not correct for all cases. * * @param array $record * The raw source values. * * @return array * The flattened values. * * @see \Drupal\reinstall\Plugin\migrate\process\TermParent */ protected function flattenRecord(array $record) { $row = new Row($record); $this->flattenRow($row); return $row->getSource(); } /** * Skip users 0 and 1 in imports, as they are core-provided. * * @param array $record * The description of a user entity. * * @return bool * Include it (1) or filter it (0). */ protected function filter01(array $record) { return ($record['uid'] ?? 0) > 1; } /** * {@inheritdoc} */ public function fields() { $ret = [ 'uid' => 'User ID', 'uuid' => 'UUID', 'langcode' => 'ISO 639 language code', 'preferred_langcode' => 'ISO 639 preferred language code', 'preferred_admin_langcode' => 'ISO 639 preferred administrative language code', 'name' => 'The user name (PK)', 'mail' => 'The current user e-mail address', 'timezone' => 'The user timezone', 'status' => 'The user status', 'access' => 'Latest access timestamp', 'login' => 'Latest login timestamp', 'init' => 'Initial user e-mail address', 'created' => 'User creation timestamp', 'changed' => 'Modification timestamp', 'default_langcode' => 'ISO 639 default language code', ]; return $ret; } /** * {@inheritdoc} */ public function getIds() { $ids = [ 'uid' => [ 'type' => 'integer', ], ]; return $ids; } }