-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80ef597
commit 62eebc3
Showing
4 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,26 +15,18 @@ | |
|
||
use Sonata\AdminBundle\Admin\AdminInterface; | ||
use Sonata\AdminBundle\Datagrid\PagerInterface; | ||
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | ||
use Sonata\AdminBundle\Filter\FilterInterface; | ||
|
||
/** | ||
* @author Thomas Rabaix <[email protected]> | ||
*/ | ||
final class SearchHandler | ||
final class SearchHandler implements SearchHandlerInterface | ||
{ | ||
/** | ||
* @var array<string, bool> | ||
*/ | ||
private array $adminsSearchConfig = []; | ||
|
||
/** | ||
* @throws \RuntimeException | ||
* | ||
* @phpstan-template T of object | ||
* @phpstan-param AdminInterface<T> $admin | ||
* @phpstan-return PagerInterface<ProxyQueryInterface<T>>|null | ||
*/ | ||
public function search(AdminInterface $admin, string $term, int $page = 0, int $offset = 20): ?PagerInterface | ||
{ | ||
// If the search is disabled for the whole admin, skip any further processing. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Search; | ||
|
||
use Sonata\AdminBundle\Admin\AdminInterface; | ||
use Sonata\AdminBundle\Datagrid\PagerInterface; | ||
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | ||
|
||
interface SearchHandlerInterface | ||
{ | ||
/** | ||
* @throws \RuntimeException | ||
* | ||
* @phpstan-template T of object | ||
* @phpstan-param AdminInterface<T> $admin | ||
* @phpstan-return PagerInterface<ProxyQueryInterface<T>>|null | ||
*/ | ||
public function search(AdminInterface $admin, string $term, int $page = 0, int $offset = 20): ?PagerInterface; | ||
} |