/** @var EventDispatcher */
private $eventDispatcher;
- /** @var \OCP\IDBConnection */
- private $connection;
-
/**
* \OC\User\Database constructor.
*
public function __construct($eventDispatcher = null) {
$this->cache = new CappedMemoryCache();
$this->eventDispatcher = $eventDispatcher ? $eventDispatcher : \OC::$server->getEventDispatcher();
- $this->connection = \OC::$server->getDatabaseConnection();
}
/**
$parameters = [];
$searchLike = '';
if ($search !== '') {
- $parameters[] = '%' . $this->connection->escapeLikeParameter($search) . '%';
- $parameters[] = '%' . $this->connection->escapeLikeParameter($search) . '%';
+ $parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
+ $parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
$searchLike = ' WHERE LOWER(`displayname`) LIKE LOWER(?) OR '
. 'LOWER(`uid`) LIKE LOWER(?)';
}
$parameters = [];
$searchLike = '';
if ($search !== '') {
- $parameters[] = '%' . $this->connection->escapeLikeParameter($search) . '%';
+ $parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
$searchLike = ' WHERE LOWER(`uid`) LIKE LOWER(?)';
}