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 ...@@ -34,17 +34,11 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
'lastname' => QueryInterface::ORDER_ASCENDING 'lastname' => QueryInterface::ORDER_ASCENDING
]; ];
/** public function findByStringAndMembership(string $filterString, int $filterMembership): QueryResultInterface
* @param string $filterString
* @param integer $filterMembership
* @return QueryResultInterface
*/
public function findByStringAndMembership($filterString, $filterMembership)
{ {
$query = $this->createQuery(); $query = $this->createQuery();
$constraints = []; $constraints = [];
if ($filterString) { if ($filterString) {
$filterString = $this->getDatabaseConnection()->escapeStrForLike($filterString, 'tx_t3omembership_domain_model_member');
$constraints = $query->logicalOr( $constraints = $query->logicalOr(
[ [
$query->like('name', '%' . $filterString . '%'), $query->like('name', '%' . $filterString . '%'),
...@@ -59,12 +53,4 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository ...@@ -59,12 +53,4 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
return $query->matching($query->logicalAnd($constraints))->execute(); 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