PHRAS-3277 create event recordsWitemeta

This commit is contained in:
aina esokia
2020-11-20 17:10:58 +03:00
parent c43f7672e4
commit e23b9dd294
22 changed files with 201 additions and 47 deletions

View File

@@ -13,6 +13,8 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Alchemy\Phrasea\Command\Command;
use Alchemy\Phrasea\WorkerManager\Event\WorkerEvents;
use Alchemy\Phrasea\WorkerManager\Event\RecordsWriteMetaEvent;
class module_console_fieldsRename extends Command
{
@@ -106,6 +108,11 @@ class module_console_fieldsRename extends Command
unset($record);
}
// order to write metas for those records
$this->container['dispatcher']->dispatch(WorkerEvents::RECORDS_WRITE_META,
new RecordsWriteMetaEvent(array_column($results, 'record_id'), $input->getArgument('sbas_id'))
);
$start += $quantity;
} while (count($results) > 0);