type fixes

This commit is contained in:
Yuri Kuznetsov
2021-11-03 11:17:47 +02:00
parent 1cfacc3813
commit 901e0967fc
3 changed files with 13 additions and 12 deletions

View File

@@ -359,7 +359,7 @@ class Import
$this->entityManager->createEntity('ImportEntity', [
'entityType' => $this->entityType,
'entityId' => $rowResult->id,
'importId' => $import->id,
'importId' => $import->getId(),
'isImported' => $rowResult->isImported ?? false,
'isUpdated' => $rowResult->isUpdated ?? false,
'isDuplicate' => $rowResult->isDuplicate ?? false,
@@ -421,7 +421,7 @@ class Import
}
$entity = $this->entityManager
->getRepository($this->entityType)
->getRDBRepository($this->entityType)
->where($whereClause)
->findOne();
@@ -448,6 +448,8 @@ class Import
$entity = $this->entityManager->getEntity($this->entityType);
}
assert($entity instanceof Entity);
$isNew = $entity->isNew();
$entity->set($params->getDefaultValues());
@@ -501,8 +503,7 @@ class Import
}
if (
$entity->getAttributeType($attribute) === Entity::FOREIGN
&&
$entity->getAttributeType($attribute) === Entity::FOREIGN &&
$entity->getAttributeParam($attribute, 'foreign') === 'name'
) {
$this->processForeignName($entity, $attribute);
@@ -519,10 +520,10 @@ class Import
}
}
if ($entity->id) {
if ($entity->getId()) {
$this->entityManager
->getRepository($entity->getEntityType())
->deleteFromDb($entity->id, true);
->getRDBRepository($entity->getEntityType())
->deleteFromDb($entity->getId(), true);
}
try {
@@ -533,7 +534,7 @@ class Import
'silent' => $params->isSilentMode(),
]);
$result['id'] = $entity->id;
$result['id'] = $entity->getId();
if ($isNew) {
$result['isImported'] = true;
@@ -607,13 +608,13 @@ class Import
}
$found = $this->entityManager
->getRepository($foreignEntityType)
->getRDBRepository($foreignEntityType)
->select(['id', 'name'])
->where($where)
->findOne();
if ($found) {
$entity->set($relation . 'Id', $found->id);
$entity->set($relation . 'Id', $found->getId());
$entity->set($relation . 'Name', $found->get('name'));
return;

View File

@@ -178,7 +178,7 @@ class Kanban
'groupList' => [],
];
$repository = $this->entityManager->getRepository($this->entityType);
$repository = $this->entityManager->getRDBRepository($this->entityType);
foreach ($statusList as $status) {
if (in_array($status, $statusIgnoreList)) {

View File

@@ -125,7 +125,7 @@ class OrdererProcessor
$minOrder = null;
$first = $this->entityManager
->getRepository('KanbanOrder')
->getRDBRepository('KanbanOrder')
->select(['id', 'order'])
->where([
'entityType' => $this->entityType,