Chris@0: . Chris@0: */ Chris@0: Chris@0: namespace Doctrine\Common\Collections; Chris@0: Chris@0: /** Chris@0: * Interface for collections that allow efficient filtering with an expression API. Chris@0: * Chris@0: * Goal of this interface is a backend independent method to fetch elements Chris@0: * from a collections. {@link Expression} is crafted in a way that you can Chris@0: * implement queries from both in-memory and database-backed collections. Chris@0: * Chris@0: * For database backed collections this allows very efficient access by Chris@0: * utilizing the query APIs, for example SQL in the ORM. Applications using Chris@0: * this API can implement efficient database access without having to ask the Chris@0: * EntityManager or Repositories. Chris@0: * Chris@0: * @author Benjamin Eberlei Chris@0: * @since 2.3 Chris@0: */ Chris@0: interface Selectable Chris@0: { Chris@0: /** Chris@0: * Selects all elements from a selectable that match the expression and Chris@0: * returns a new collection containing these elements. Chris@0: * Chris@0: * @param Criteria $criteria Chris@0: * Chris@0: * @return Collection Chris@0: */ Chris@0: public function matching(Criteria $criteria); Chris@0: }