Doctrine ORM support for ViewComponents
- PHP 5.5+ (hhvm & php7 are supported)
The recommended way of installing the component is through Composer.
Run following command from your project folder:
composer require view-components/doctrine-data-processing
Code example:
use Doctrine\DBAL\Query\QueryBuilder;
use ViewComponents\Doctrine\DoctrineDataProvider;
use ViewComponents\ViewComponents\Data\Operation\FilterOperation;
$builder = new QueryBuilder($doctrineConnection);
$builder
->select('*')
->from('test_users');
$provider = new DoctrineDataProvider($builder);
$provider->operations()->add(
new FilterOperation('role', FilterOperation::OPERATOR_EQ, 'Manager')
);
foreach ($provider as $user) {
var_dump($user);
}
Please see Contributing Guidelines and Code of Conduct for details.
This package bundled with unit tests (PHPUnit).
To run tests locally, you must install this package as stand-alone project with dev-dependencies:
composer create-project view-components/doctrine-data-processing
Command for running tests:
composer test
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
© 2015 — 2016 Vitalii Stepanenko
Licensed under the MIT License.
Please see License File for more information.