Skip to content

Commit

Permalink
fixup! read records from DB for lists at once, not one by one.
Browse files Browse the repository at this point in the history
  • Loading branch information
blizzz committed Mar 13, 2020
1 parent d6e57ad commit acd0a83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/user_ldap/lib/Mapping/AbstractMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@

namespace OCA\User_LDAP\Mapping;

use OC\DB\QueryBuilder\QueryBuilder;

/**
* Class AbstractMapping
*
* @package OCA\User_LDAP\Mapping
*/
abstract class AbstractMapping {
Expand Down Expand Up @@ -182,7 +185,7 @@ public function getListOfIdsByDn(array $fdns): array {
$qb = $this->dbc->getQueryBuilder();
$qb->select('owncloud_name', 'ldap_dn')
->from($this->getTableName(false))
->where($qb->expr()->in('ldap_dn', $qb->createNamedParameter($fdns)));
->where($qb->expr()->in('ldap_dn', $qb->createNamedParameter($fdns, QueryBuilder::PARAM_STR_ARRAY)));
$stmt = $qb->execute();

$results = $stmt->fetchAll(\Doctrine\DBAL\FetchMode::ASSOCIATIVE);
Expand Down

0 comments on commit acd0a83

Please sign in to comment.