| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Doctrine\Common\Collections; |
| 6 |
|
| 7 |
/** |
| 8 |
* Interface for collections that allow efficient filtering with an expression API. |
| 9 |
* |
| 10 |
* Goal of this interface is a backend independent method to fetch elements |
| 11 |
* from a collections. {@link Expression} is crafted in a way that you can |
| 12 |
* implement queries from both in-memory and database-backed collections. |
| 13 |
* |
| 14 |
* For database backed collections this allows very efficient access by |
| 15 |
* utilizing the query APIs, for example SQL in the ORM. Applications using |
| 16 |
* this API can implement efficient database access without having to ask the |
| 17 |
* EntityManager or Repositories. |
| 18 |
* |
| 19 |
* @phpstan-template TKey as array-key |
| 20 |
* @phpstan-template-covariant T |
| 21 |
*/ |
| 22 |
interface Selectable |
| 23 |
{ |
| 24 |
/** |
| 25 |
* Selects all elements from a selectable that match the expression and |
| 26 |
* returns a new collection containing these elements and preserved keys. |
| 27 |
* |
| 28 |
* @return ReadableCollection<mixed>&Selectable<mixed> |
| 29 |
* @phpstan-return ReadableCollection<TKey,T>&Selectable<TKey,T> |
| 30 |
*/ |
| 31 |
public function matching(Criteria $criteria); |
| 32 |
} |