Commit b0ed0341 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Remove TYPO3_DB dependency

parent 30c0106e
......@@ -34,17 +34,11 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
'lastname' => QueryInterface::ORDER_ASCENDING
];
/**
* @param string $filterString
* @param integer $filterMembership
* @return QueryResultInterface
*/
public function findByStringAndMembership($filterString, $filterMembership)
public function findByStringAndMembership(string $filterString, int $filterMembership): QueryResultInterface
{
$query = $this->createQuery();
$constraints = [];
if ($filterString) {
$filterString = $this->getDatabaseConnection()->escapeStrForLike($filterString, 'tx_t3omembership_domain_model_member');
$constraints = $query->logicalOr(
[
$query->like('name', '%' . $filterString . '%'),
......@@ -59,12 +53,4 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
return $query->matching($query->logicalAnd($constraints))->execute();
}
/**
* @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected function getDatabaseConnection()
{
return $GLOBALS['TYPO3_DB'];
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment