GithubHelp home page GithubHelp logo

queryutils's Introduction

Query Utils

Set of Doctrine ORM query helpers.

Prepared Queries

All predefined queries share common ancestor: Query\BaseQuery. This class exposes these public methods:

  1. bindExprTo($qb) - binds generated expression to your QueryBuilder,
  2. bindParametersTo($qb) - binds generated parameters to your QueryBuilder,
  3. bindTo($qb) - binds expression and parameters to your QueryBuilder.

Also, bindExprTo and bindTo have second, optional parameter $method which defaults to and. This represents method used for binding.

  1. if and is passed, $qb->andWhere(...) is used,
  2. if or is passed, $qb->orWhere(...) is used.

Full-text Query

For string $q to lookup on columns client.firstName and client.lastName use following:

long form:

$helper = new \ADT\QueryUtils\Query\FullTextQuery($q, [
    'client.firstName', 'client.lastName'
]);
 
$helper->bindTo($queryBuilder);

or short form:

\ADT\QueryUtils\Query\FullTextQuery::create($q, [
    'client.firstName', 'client.lastName'
])->bindTo($queryBuilder);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.