Download the PHP package rikbruil/doctrine-specification without Composer
On this page you can find all versions of the php package rikbruil/doctrine-specification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rikbruil/doctrine-specification
More information about rikbruil/doctrine-specification
Files in rikbruil/doctrine-specification
Package doctrine-specification
Short Description Doctrine Specification pattern for building queries dynamically and with re-usable classes for composition.
License MIT
Informations about the package doctrine-specification
Doctrine Specification
Doctrine Specification pattern for building queries dynamically and with re-usable classes for composition.
This library started out as an adaptation of Benjamin Eberlei's blog post. I was also inspired by the Happyr Doctrine-Specification code, however this library has some small differences. The main one is that SpecificationRepository->match() does not return the results directly, but returns the query object.
Since I like Doctrine's Paginator object, I wanted to be able to use that in combination with the Specification pattern.
Note: In versions prior to 1.2 it was required to extend the SpecificationRepository class. This is no longer needed since we provide a SpecificationRepositoryTrait that you can use instead. The class is still provided for backwards compatibility reasons. There is also the SpecificationAwareInterface that you can use if you need it.
Usage
Install the latest version with composer require rikbruil/doctrine-specification
Composition
A bonus of this pattern is composition, which makes specifications very reusable:
Requirements
Doctrine-Specification requires:
- PHP 5.5+
- Doctrine 2.2
License
Doctrine-Specification is licensed under the MIT License - see the LICENSE
file for details
Acknowledgements
This library is heavily inspired by Benjamin Eberlei's blog post and Happyr's Doctrine-Specification library.
All versions of doctrine-specification with dependencies
doctrine/orm Version ^2.2
doctrine/collections Version ^1.2
rikbruil/specification Version 0.9.*