Download the PHP package inlm/query-object without Composer

On this page you can find all versions of the php package inlm/query-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package query-object

WARNING! This library is ABANDONED, use mibk/LeanMapperQuery instead. It contains all changes from this library and much more.


Lean Mapper Query

Lean Mapper Query is a concept of a query object for Lean Mapper library which helps to build complex queries using automatic joins (idea taken from NotORM library). Look at the suggested base classes. For Czech documentation have a look at the wiki.

Features

Installation

It can be installed via Composer.

What does it do?

Suppose we have following repositories:

and following entities:

We build a query:

Now, if we want to get all books whose author's name is Karel, we have to do this:

Database query will look like this:

You can see it performs automatic joins via dot notation. It supports all types of relationships which are known to Lean Mapper.

It is very easy to use SQL functions. We can update query like this:

and change the database query into following:

Don't repeat yourself

You can extend Query and define own methods.

Querying entities

It is also possible to query an entity property (currently only those properties with BelongsToMany or HasMany relationships). Let's build BaseEntity:

Note that BaseEntity extends Inlm\QueryObject\Entity to make the following possible.

We have defined the find method as protected because with specifying the method name in $magicMethodsPrefixes property you can query entities like this:

The magic method findTags will eventually call your protected method find with 'tags' as the 1 argument.

The resulting database query looks like this:

The first condition in where clause [tag].[id] IN (1, 2) is taken from the entity traversing (tags are queried against this particular book entity's own tags).

What else you can do?

If we slightly modify our BaseRepository and BaseEntity we can simplify working with query objects. To achieve this look at the suggested base classes. It makes the following possible.

License

Copyright (c) 2013 Michal Bohuslávek

Licensed under the MIT license.


All versions of query-object with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
tharos/leanmapper Version >=2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package inlm/query-object contains the following files

Loading the files please wait ....