diff --git a/core/modules/migrate/src/Entity/Migration.php b/core/modules/migrate/src/Entity/Migration.php index be69b2b..5f6ce5a 100644 --- a/core/modules/migrate/src/Entity/Migration.php +++ b/core/modules/migrate/src/Entity/Migration.php @@ -388,62 +388,81 @@ public function isComplete() { * {@inheritdoc} */ public function getProcess() { - return $this->get('process'); + return $this->process; } /** * {@inheritdoc} */ public function setProcess(array $process) { - $this->set('process', $process); + $this->process = $process; } /** * {@inheritdoc} */ public function getSystemOfRecord() { - return $this->get('systemOfRecord'); + return $this->systemOfRecord; + } + + /** + * {@inheritdoc} + */ + public function setSystemOfRecord($system_of_record) { + if ($system_of_record != self::SOURCE && $system_of_record != self::DESTINATION) { + throw new \InvalidArgumentException(String::format("The system-of-record '@systemofrecord' is not valid.", [ + '@systemofrecord' => $system_of_record, + ])); + } + $this->systemOfRecord = $system_of_record; } /** * {@inheritdoc} */ public function isTrackLastImported() { - return $this->get('trackLastImported'); + return $this->trackLastImported; + } + + /** + * {@inheritdoc} + */ + public function setTrackLastImported($track_last_imported) { + return $this->trackLastImported = (bool) $track_last_imported; } /** * {@inheritdoc} */ public function getSource() { - return $this->get('source'); + return $this->source; } /** * {@inheritdoc} */ public function setSource(array $source) { - $this->set('source', $source); + $this->source = $source; } /** * {@inheritdoc} */ public function getDestination() { - return $this->get('destination'); + return $this->destination; } /** * {@inheritdoc} */ public function setDestination(array $destination) { - $this->set('destination', $destination); + $this->destination = $destination; } /** * {@inheritdoc} */ public function getMigrationDependencies() { - return $this->get('migration_dependencies'); + return $this->migration_dependencies; } } diff --git a/core/modules/migrate/src/Entity/MigrationInterface.php b/core/modules/migrate/src/Entity/MigrationInterface.php index 2904fb0..12514c8 100644 --- a/core/modules/migrate/src/Entity/MigrationInterface.php +++ b/core/modules/migrate/src/Entity/MigrationInterface.php @@ -204,6 +204,14 @@ public function setProcess(array $process); public function getSystemOfRecord(); /** + * Set the system of record for the migration. + * + * @param string $system_of_record + * The system of record of the migration. + */ + public function setSystemOfRecord($system_of_record); + + /** * Checks if the migration should track time of last import. * * @return bool @@ -212,6 +220,14 @@ public function getSystemOfRecord(); public function isTrackLastImported(); /** + * Set if the migration should track time of last import. + * + * @param bool $track_last_imported + * Boolean value to indicate if the migration should track last import time. + */ + public function setTrackLastImported($track_last_imported); + + /** * Get the source configuration of this migration. * * @return array