record service create: keep new

This commit is contained in:
Yuri Kuznetsov
2024-04-19 09:30:49 +03:00
parent d1dd39bf5a
commit 695dc2eb42
+8 -1
View File
@@ -830,9 +830,16 @@ class Service implements Crud,
/** @noinspection PhpDeprecationInspection */
$this->beforeCreateEntity($entity, $data);
$this->entityManager->saveEntity($entity, [SaveOption::API => true]);
$this->entityManager->saveEntity($entity, [
SaveOption::API => true,
SaveOption::KEEP_NEW => true,
]);
$this->getRecordHookManager()->processAfterCreate($entity, $params);
$entity->setAsNotNew();
$entity->updateFetchedValues();
/** @noinspection PhpDeprecationInspection */
$this->afterCreateEntity($entity, $data);
/** @noinspection PhpDeprecationInspection */