connection->getQueryBuilder(); $qbSelect->select(['id', 'deploy_config']) ->from('ex_apps_daemons'); $req = $qbSelect->executeQuery(); while ($row = $req->fetch()) { $deployConfig = $row['deploy_config']; $deployConfig = json_decode($deployConfig, true); if (!empty($deployConfig['haproxy_password'])) { $deployConfig['haproxy_password'] = $this->crypto->encrypt($deployConfig['haproxy_password']); $encodedDeployConfig = json_encode($deployConfig); $qbUpdate = $this->connection->getQueryBuilder(); $qbUpdate->update('ex_apps_daemons') ->set('deploy_config', $qbUpdate->createNamedParameter($encodedDeployConfig)) ->where( $qbUpdate->expr()->eq('id', $qbUpdate->createNamedParameter($row['id'])) ); $qbUpdate->executeStatement(); } } $req->closeCursor(); return null; } }