Skip to content
Snippets Groups Projects
Commit a402dcfe authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #13243 TIME 1:20 migrate folders with keyword

parent fdb8a8b5
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,6 @@ foreach ($customs as $custom) { ...@@ -39,7 +39,6 @@ foreach ($customs as $custom) {
'level' => 0 'level' => 0
]); ]);
$GLOBALS['entities'] = \Entity\models\EntityModel::get(['select' => ['id']]);
fillEntities($masterFolderId); fillEntities($masterFolderId);
foreach ($fileplans as $fileplan) { foreach ($fileplans as $fileplan) {
...@@ -151,13 +150,12 @@ function runPositionsForPrivate($positions, $parentPositionId, $parentFolderId, ...@@ -151,13 +150,12 @@ function runPositionsForPrivate($positions, $parentPositionId, $parentFolderId,
function fillEntities($folderId) function fillEntities($folderId)
{ {
foreach ($GLOBALS['entities'] as $entity) { \Folder\models\EntityFolderModel::create([
\Folder\models\EntityFolderModel::create([ 'folder_id' => $folderId,
'folder_id' => $folderId, 'entity_id' => null,
'entity_id' => $entity['id'], 'edition' => true,
'edition' => true, 'keyword' => 'ALL_ENTITIES'
]); ]);
}
} }
function fillResources($folderId, $positionId) function fillResources($folderId, $positionId)
......
...@@ -38,7 +38,6 @@ foreach ($customs as $custom) { ...@@ -38,7 +38,6 @@ foreach ($customs as $custom) {
'level' => 0 'level' => 0
]); ]);
$GLOBALS['entities'] = \Entity\models\EntityModel::get(['select' => ['id']]);
fillEntities($masterFolderId); fillEntities($masterFolderId);
$aFolderIdMap = []; $aFolderIdMap = [];
...@@ -92,13 +91,12 @@ foreach ($customs as $custom) { ...@@ -92,13 +91,12 @@ foreach ($customs as $custom) {
function fillEntities($folderId) function fillEntities($folderId)
{ {
foreach ($GLOBALS['entities'] as $entity) { \Folder\models\EntityFolderModel::create([
\Folder\models\EntityFolderModel::create([ 'folder_id' => $folderId,
'folder_id' => $folderId, 'entity_id' => null,
'entity_id' => $entity['id'], 'edition' => true,
'edition' => true, 'keyword' => 'ALL_ENTITIES'
]); ]);
}
} }
function fillResources($folderId, $folderSystemId) function fillResources($folderId, $folderSystemId)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment