view-components/doctrine-data-processing

Doctrine ORM support for ViewComponents

v1.0.1 2016-06-14 15:05 UTC

This package is auto-updated.

Last update: 2024-12-17 23:37:06 UTC


README

Release Build Status Scrutinizer Code Quality Code Coverage

Doctrine ORM support for ViewComponents

Table of Contents

Requirements

  • PHP 5.5+ (hhvm & php7 are supported)

Installation

The recommended way of installing the component is through Composer.

Run following command from your project folder:

composer require view-components/doctrine-data-processing

Usage

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);
}

Contributing

Please see Contributing Guidelines and Code of Conduct for details.

Testing

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

Security

If you discover any security related issues, please email mail@vitaliy.in instead of using the issue tracker.

License

© 2015 — 2016 Vitalii Stepanenko

Licensed under the MIT License.

Please see License File for more information.