/** * {@inheritdoc} */ protected function processQueries(LoggerInterface $logger, $dryRun = false) { $segments = $this->connection->createQueryBuilder()->select('s.id, s.definition')->from('oro_segment', 's')->execute()->fetchAll(\PDO::FETCH_ASSOC); $segmentsToUpdate = []; foreach ($segments as $segment) { $definition = $segment['definition']; $needUpdate = false; if ($definition) { $definition = $this->connection->convertToPHPValue($definition, Type::JSON_ARRAY); if (!empty($definition['filters'])) { $updated = $this->processFilters($definition['filters'], $needUpdate); if ($needUpdate) { $definition['filters'] = $updated; $segmentsToUpdate[$segment['id']] = $definition; } } } } foreach ($segmentsToUpdate as $id => $definitionToUpdate) { $this->addSql('UPDATE oro_segment SET definition = :definition WHERE id = :id', ['id' => $id, 'definition' => $definitionToUpdate], ['id' => Type::INTEGER, 'definition' => Type::JSON_ARRAY]); } parent::processQueries($logger, $dryRun); }
/** * {@inheritdoc} */ protected function processQueries(LoggerInterface $logger, $dryRun = false) { $this->addSql('UPDATE oro_email_template SET user_owner_id = (' . $this->getAdminUserQuery() . ')', ['role' => User::ROLE_ADMINISTRATOR], ['role' => Type::STRING]); parent::processQueries($logger, $dryRun); }