Test if some keys are missing in v2 import

This commit is contained in:
Nicolas Lœuillet 2016-02-05 13:50:16 +01:00
parent 704ed658a9
commit de3b19b2ce

View file

@ -56,9 +56,15 @@ class WallabagV2Import extends WallabagV1Import implements ImportInterface
$entry->setContent($importedEntry['content']);
$entry->setReadingTime($importedEntry['reading_time']);
$entry->setDomainName($importedEntry['domain_name']);
$entry->setMimetype($importedEntry['mimetype']);
$entry->setLanguage($importedEntry['language']);
$entry->setPreviewPicture($importedEntry['preview_picture']);
if (isset($importedEntry['mimetype'])) {
$entry->setMimetype($importedEntry['mimetype']);
}
if (isset($importedEntry['language'])) {
$entry->setLanguage($importedEntry['language']);
}
if (isset($importedEntry['preview_picture'])) {
$entry->setPreviewPicture($importedEntry['preview_picture']);
}
$this->em->persist($entry);
++$this->importedEntries;