Skip to content

Commit a72b709

Browse files
committed
Use \DateTime again in Import\Category
The refactor changed this code to use Magento\Framework\Stdlib\DateTime, but it's constructor isn't the same as \DateTime, so I reverted it. \DateTime->new accepting null is deprecated, so I also fixed that warning
1 parent db3d2ce commit a72b709

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Model/Import/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,13 +954,13 @@ private function saveCategories(): self
954954

955955
$time = !empty($rowData[CategoryModel::KEY_CREATED_AT])
956956
? strtotime($rowData[CategoryModel::KEY_CREATED_AT])
957-
: null;
957+
: 'now';
958958

959959
// entity table data
960960
$entityRow = [
961961
CategoryInterface::KEY_PARENT_ID => $parentCategory['entity_id'],
962962
CategoryInterface::KEY_LEVEL => $parentCategory[CategoryInterface::KEY_LEVEL] + 1,
963-
CategoryInterface::KEY_CREATED_AT => (new DateTime($time))
963+
CategoryInterface::KEY_CREATED_AT => (new \DateTime($time))
964964
->format(DateTime::DATETIME_PHP_FORMAT),
965965
CategoryInterface::KEY_UPDATED_AT => "now()",
966966
CategoryInterface::KEY_POSITION => $rowData[CategoryInterface::KEY_POSITION]

0 commit comments

Comments
 (0)