Loading src/Filter/Date.php +4 −4 Original line number Diff line number Diff line Loading @@ -11,10 +11,6 @@ final class Date extends HttpFilter { public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { $queryBuilder->where( 'SUBSTRING(' . $this->getColumn() . ', 0, 11) = :' . $this->getParameterKey(), ); if (is_null($this->getHttpValue())) { return $queryBuilder; } Loading @@ -23,6 +19,10 @@ final class Date extends HttpFilter return $queryBuilder; } $queryBuilder->where( 'SUBSTRING(' . $this->getColumn() . ', 0, 11) = :' . $this->getParameterKey(), ); $queryBuilder->setParameter($this->getParameterKey(), $this->getHttpValue()); return $queryBuilder; Loading src/Filter/Like.php +4 −4 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ final class Like extends HttpFilter { public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { $queryBuilder->where( $this->getColumn() . ' LIKE :' . $this->getParameterKey(), ); if ($this->getHttpValue() === null) { return $queryBuilder; } $queryBuilder->where( $this->getColumn() . ' LIKE :' . $this->getParameterKey(), ); $queryBuilder->setParameter($this->getParameterKey(), '%' . $this->getHttpValue() . '%'); return $queryBuilder; Loading src/Filter/Where.php +4 −4 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ final class Where extends HttpFilter { public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { $queryBuilder->where( $this->getColumn() . ' = :' . $this->getParameterKey(), ); if ($this->getHttpValue() === null) { return $queryBuilder; } $queryBuilder->where( $this->getColumn() . ' = :' . $this->getParameterKey(), ); $queryBuilder->setParameter($this->getParameterKey(), $this->getHttpValue()); return $queryBuilder; Loading tests/FilterByLikeTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ class FilterByLikeTest extends TestCase $this->assertCount($countPosts, $result); } public function testFilterDateWithDifferentKey(): void public function testFilterLikeWithDifferentKey(): void { /** @var PostRepository $postRepository */ $postRepository = $this->em->getRepository(Post::class); Loading Loading
src/Filter/Date.php +4 −4 Original line number Diff line number Diff line Loading @@ -11,10 +11,6 @@ final class Date extends HttpFilter { public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { $queryBuilder->where( 'SUBSTRING(' . $this->getColumn() . ', 0, 11) = :' . $this->getParameterKey(), ); if (is_null($this->getHttpValue())) { return $queryBuilder; } Loading @@ -23,6 +19,10 @@ final class Date extends HttpFilter return $queryBuilder; } $queryBuilder->where( 'SUBSTRING(' . $this->getColumn() . ', 0, 11) = :' . $this->getParameterKey(), ); $queryBuilder->setParameter($this->getParameterKey(), $this->getHttpValue()); return $queryBuilder; Loading
src/Filter/Like.php +4 −4 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ final class Like extends HttpFilter { public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { $queryBuilder->where( $this->getColumn() . ' LIKE :' . $this->getParameterKey(), ); if ($this->getHttpValue() === null) { return $queryBuilder; } $queryBuilder->where( $this->getColumn() . ' LIKE :' . $this->getParameterKey(), ); $queryBuilder->setParameter($this->getParameterKey(), '%' . $this->getHttpValue() . '%'); return $queryBuilder; Loading
src/Filter/Where.php +4 −4 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ final class Where extends HttpFilter { public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { $queryBuilder->where( $this->getColumn() . ' = :' . $this->getParameterKey(), ); if ($this->getHttpValue() === null) { return $queryBuilder; } $queryBuilder->where( $this->getColumn() . ' = :' . $this->getParameterKey(), ); $queryBuilder->setParameter($this->getParameterKey(), $this->getHttpValue()); return $queryBuilder; Loading
tests/FilterByLikeTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ class FilterByLikeTest extends TestCase $this->assertCount($countPosts, $result); } public function testFilterDateWithDifferentKey(): void public function testFilterLikeWithDifferentKey(): void { /** @var PostRepository $postRepository */ $postRepository = $this->em->getRepository(Post::class); Loading