-
-
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
247131e
commit 1716254
Showing
4 changed files
with
25 additions
and
10 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 |
---|---|---|
|
@@ -21,20 +21,13 @@ | |
/** | ||
* @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,19 @@ | ||
<?php | ||
|
||
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; | ||
} |