protected function EntityProcessorBase::setChangedTime in Content Synchronizer 8
Same name and namespace in other branches
- 8.2 src/Processors/Entity/EntityProcessorBase.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorBase::setChangedTime()
- 3.x src/Processors/Entity/EntityProcessorBase.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorBase::setChangedTime()
Update the changed time form the data array.
Parameters
\Drupal\Core\Entity\Entity $entity: The entity to update.
array $dataToImport: THe data to import.
2 calls to EntityProcessorBase::setChangedTime()
- EntityProcessorBase::getEntityToImport in src/
Processors/ Entity/ EntityProcessorBase.php - Return the entity to import.
- EntityProcessorBase::import in src/
Processors/ Entity/ EntityProcessorBase.php - Create or update entity with data :.
File
- src/
Processors/ Entity/ EntityProcessorBase.php, line 325
Class
- EntityProcessorBase
- The entity processor base.
Namespace
Drupal\content_synchronizer\Processors\EntityCode
protected function setChangedTime(Entity $entity, array $dataToImport) {
$dataToImport = array_key_exists('translations', $dataToImport) ? $dataToImport['translations'][$entity
->language()
->getId()] : $dataToImport;
if (array_key_exists(ExportEntityWriter::FIELD_CHANGED, $dataToImport)) {
if (method_exists($entity, 'setChangedTime')) {
$entity
->setChangedTime($dataToImport[ExportEntityWriter::FIELD_CHANGED]);
}
}
}