2017 © Pedro Peláez
 

library roave-db-criteria

image

roave/roave-db-criteria

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

RoaveDbCriteria

Build Status Scrutinizer Code Quality Code Coverage, (*1)

v0.0.1, (*2)

Example Usage

<?php
use Roave\DbCriteria\QueryExpressionVisitor;
use Doctrine\Common\Collections\Criteria;

class ContactMapper
{
    protected $visitor;
    protected $tableGateway;

    public function find(Criteria $citeria)
    {
        $select = $this->tableGateway->getSql()->select()
                       // You can apply your own Zend\Db\Sql query conditions
                       ->where(array('user_id' => $this->activeUser->id));

        // Then apply the criteria to the query
        $where  = $this->visitor->dispatch($criteria->getWhereExpression());
        $select->where($where);

        // Finally, apply limit, offset, order, and execute the select query
        QueryExpressionVisitor::apply($select, $criteria);

        return $this->tableGateway->selectWith($select);
    }
}

<?php
use Doctrine\Common\Collections\Criteria;

$criteria = Criteria::create()
                ->where(Criteria::expr()->eq('first_name', 'Evan'))
                ->andWhere(Criteria::expr()->eq('last_name', 'Coury'));

$contacts = $contactMapper->find($criteria);

In practice, you can create domain-specific criteria objects and plenty of other cool things., (*3)

The Versions

07/05 2014

dev-master

9999999-dev https://github.com/Roave/RoaveDbCriteria

  Sources   Download

MIT

The Requires

 

The Development Requires

doctrine module zendframework zenddb roave

03/05 2014

dev-feature/travis-scrutinizer

dev-feature/travis-scrutinizer https://github.com/Roave/RoaveDbCriteria

  Sources   Download

MIT

The Requires

 

The Development Requires

doctrine module zendframework zenddb roave

03/05 2014

dev-test/null-comparison-tests

dev-test/null-comparison-tests https://github.com/Roave/RoaveDbCriteria

  Sources   Download

MIT

The Requires

 

The Development Requires

doctrine module zendframework zenddb roave

03/05 2014

dev-bug/invalid-in-predicate

dev-bug/invalid-in-predicate https://github.com/Roave/RoaveDbCriteria

  Sources   Download

MIT

The Requires

 

The Development Requires

doctrine module zendframework zenddb roave

03/05 2014

dev-cleanups

dev-cleanups https://github.com/Roave/RoaveDbCriteria

  Sources   Download

MIT

The Requires

 

The Development Requires

doctrine module zendframework zenddb roave