mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
Duplicate ignore order
This commit is contained in:
@@ -60,6 +60,10 @@ class EntityDuplicator
|
||||
|
||||
$entityDefs = $this->defs->getEntity($entityType);
|
||||
|
||||
foreach ($entityDefs->getFieldList() as $fieldDefs) {
|
||||
$this->processIgnoreField($entity, $fieldDefs, $valueMap);
|
||||
}
|
||||
|
||||
foreach ($entityDefs->getFieldList() as $fieldDefs) {
|
||||
$this->processField($entity, $fieldDefs, $valueMap);
|
||||
}
|
||||
@@ -71,7 +75,7 @@ class EntityDuplicator
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
private function processField(Entity $entity, FieldDefs $fieldDefs, stdClass $valueMap): void
|
||||
private function processIgnoreField(Entity $entity, FieldDefs $fieldDefs, stdClass $valueMap): void
|
||||
{
|
||||
$entityType = $entity->getEntityType();
|
||||
$field = $fieldDefs->getName();
|
||||
@@ -82,7 +86,15 @@ class EntityDuplicator
|
||||
foreach ($attributeList as $attribute) {
|
||||
unset($valueMap->$attribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function processField(Entity $entity, FieldDefs $fieldDefs, stdClass $valueMap): void
|
||||
{
|
||||
$entityType = $entity->getEntityType();
|
||||
$field = $fieldDefs->getName();
|
||||
|
||||
if ($this->toIgnoreField($entityType, $fieldDefs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user