Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023

This commit is contained in:
Pantheon Automation 2015-09-04 13:20:09 -07:00 committed by Greg Anderson
parent 2720a9ec4b
commit f3791f1da3
1898 changed files with 54300 additions and 11481 deletions

View file

@ -24,7 +24,6 @@ use Drupal\Component\Utility\NestedArray;
* @ConfigEntityType(
* id = "migration",
* label = @Translation("Migration"),
* module = "migrate",
* handlers = {
* "storage" = "Drupal\migrate\MigrationStorage"
* },
@ -232,6 +231,13 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
*/
protected $dependencies = [];
/**
* The ID of the template from which this migration was derived, if any.
*
* @var string|NULL
*/
protected $template;
/**
* The entity manager.
*
@ -239,6 +245,19 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
*/
protected $entityManager;
/**
* Labels corresponding to each defined status.
*
* @var array
*/
protected $statusLabels = [
self::STATUS_IDLE => 'Idle',
self::STATUS_IMPORTING => 'Importing',
self::STATUS_ROLLING_BACK => 'Rolling back',
self::STATUS_STOPPING => 'Stopping',
self::STATUS_DISABLED => 'Disabled',
];
/**
* {@inheritdoc}
*/
@ -397,20 +416,53 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
return $this->entityManager;
}
/**
* {@inheritdoc}
*/
public function setStatus($status) {
\Drupal::keyValue('migrate_status')->set($this->id(), $status);
}
/**
* {@inheritdoc}
*/
public function getStatus() {
return \Drupal::keyValue('migrate_status')->get($this->id(), static::STATUS_IDLE);
}
/**
* {@inheritdoc}
*/
public function getStatusLabel() {
$status = $this->getStatus();
if (isset($this->statusLabels[$status])) {
return $this->statusLabels[$status];
}
else {
return '';
}
}
/**
* {@inheritdoc}
*/
public function setMigrationResult($result) {
$migrate_result_store = \Drupal::keyValue('migrate_result');
$migrate_result_store->set($this->id(), $result);
\Drupal::keyValue('migrate_result')->set($this->id(), $result);
}
/**
* {@inheritdoc}
*/
public function getMigrationResult() {
$migrate_result_store = \Drupal::keyValue('migrate_result');
return $migrate_result_store->get($this->id(), static::RESULT_INCOMPLETE);
return \Drupal::keyValue('migrate_result')->get($this->id(), static::RESULT_INCOMPLETE);
}
/**
* {@inheritdoc}
*/
public function interruptMigration($result) {
$this->setStatus(MigrationInterface::STATUS_STOPPING);
$this->setMigrationResult($result);
}
/**
@ -428,6 +480,10 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
// Invalidate the source plugin.
unset($this->sourcePlugin);
}
elseif ($property_name === 'destination') {
// Invalidate the destination plugin.
unset($this->destinationPlugin);
}
return parent::set($property_name, $value);
}