public function ContentDatabaseStorage::cs_write in Content Synchronization 8.2
Same name and namespace in other branches
- 3.0.x src/Content/ContentDatabaseStorage.php \Drupal\content_sync\Content\ContentDatabaseStorage::cs_write()
File
- src/
Content/ ContentDatabaseStorage.php, line 16
Class
- ContentDatabaseStorage
- Defines the Database storage.
Namespace
Drupal\content_sync\ContentCode
public function cs_write($name, array $data, $collection) {
$data = $this
->encode($data);
try {
return $this
->cs_doWrite($name, $data, $collection);
} catch (\Exception $e) {
// If there was an exception, try to create the table.
if ($this
->ensureTableExists()) {
return $this
->cs_doWrite($name, $data, $collection);
}
// Some other failure that we can not recover from.
throw $e;
}
}