initialParse($configuration)); $this->records = $rawRecords; } protected function flattenRecord($record) { $row = new Row($record); $this->flattenRow($row); return $row->getSource(); } /** * {@inheritdoc} */ public function fields() { $ret = [ 'changed' => 'Modification timestamp', 'default_langcode' => 'ISO 639 default language code', 'description' => 'The entity description', 'langcode' => 'ISO 639 language code', 'name' => 'The term name (PK)', 'parent' => 'Parent term ID', 'path' => 'Optional path alias', 'tid' => 'Taxonomy term ID', 'uuid' => 'UUID', 'vid' => 'Vocabulary ID', 'weight' => 'Poids', ]; return $ret; } /** * {@inheritdoc} */ public function getIds() { $ids = [ 'tid' => [ 'type' => 'integer', ], ]; return $ids; } /** * Obtain the term parents from either of their two formats. * * @param mixed $source * A parent, from the migration pipeline. * * @return mixed * The parent, as its target_id. * * @see (reinstall)/README.md */ public static function getParent($source) { if (is_scalar($source)) { return $source; } elseif (isset($source['target_id'])) { return $source['target_id']; } } }