Download the PHP package bakame/csv-doctrine-collection-bridge without Composer
On this page you can find all versions of the php package bakame/csv-doctrine-collection-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bakame/csv-doctrine-collection-bridge
More information about bakame/csv-doctrine-collection-bridge
Files in bakame/csv-doctrine-collection-bridge
Package csv-doctrine-collection-bridge
Short Description Csv Doctrine Collection bridge using League\Csv
License MIT
Homepage https://github.com/bakame-php/csv-doctrine-collections-bridge
Informations about the package csv-doctrine-collection-bridge
League CSV - Doctrine Collection Bridge
This package contains:
- a class to convert League Csv objects into Doctrine Collections objects.
- a class to enable using Doctrine Collections powerful Expression API on League Csv objects.
System Requirements
- league/csv >= 9.6
- doctrine/collection >= 1.6.0
but the latest stable version of each dependency is recommended.
Installation
Usage
Converting a League\Csv\Reader
into a Doctrine Collection object.
Converting a League\Csv\ResultSet
into a Doctrine Collection object.
Using Doctrine Criteria to filter a League\Csv\Reader
object
You can simply use the provided Bakame\Csv\Extension\criteria_convert
function to convert a Doctrine\Common\Collections\Criteria
object into a League\Csv\Statement
one.
CriteriaConverter advanced usages
CriteriaConverter::convert
converts theCriteria
object into aStatement
object.CriteriaConverter::addWhere
adds theCriteria::getWhereExpression
filters to the submittedStatement
object.CriteriaConverter::addOrderBy
adds theCriteria::getOrderings
filters to the submittedStatement
object.CriteriaConverter::addInterval
adds theCriteria::getFirstResult
andCriteria::getMaxResults
filters to the submittedStatement
object.
WARNING: While the Criteria
object is mutable the Statement
object is immutable. All returned Statement
objects are new instances
Contributing
Contributions are welcome and will be fully credited. Please see CONTRIBUTING for details.
Testing
The library has a :
- a PHPUnit test suite
- a coding style compliance test suite using PHP CS Fixer.
- a code analysis compliance test suite using PHPStan.
To run the tests, run the following command from the project folder.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.