Download the PHP package hectororm/query without Composer

On this page you can find all versions of the php package hectororm/query. 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

Hector Query

Latest Version Software license Build Status Quality Grade Total Downloads

Hector Query is the query module of Hector ORM. Can be used independently of ORM.

Installation

Composer

You can install Hector Query with Composer, it's the recommended installation.

Dependencies

Usage

QueryBuilder

You can initialize the query builder with a Connection object.

Select / Insert / Update / Delete / Union

You can do a select/insert/update/delete request with specific objects:

All this classes implements StatementInterface interface. This interface provides one method to get statement and bindings:

StatementInterface::getStatement(BindParamList $bindParams)

Example of use:

Conditions

Hector Query has support of having and where conditions. Methods are sames, just replace "where" by "having" in method name.

Where / Having

Shortcuts

Columns

You can specify columns name and alias with method:

QueryBuilder::column($column, $alias)

Repeat call of this method, add a new column to the result rows ; you can reset columns with method QueryBuilder::resetColumns().

Or pass an array of column names:

QueryBuilder::columns(array $columnNames)

Group

You can group results with method:

QueryBuilder::groupBy($column)

Repeat call of this method, add a new group ; you can reset groups with method QueryBuilder::resetGroups().

If you want set WITH ROLLUP modifier to your statement, you can do it with method:

QueryBuilder::groupByWithRollup(bool $withRollup = true)

Order

You can order results with method:

QueryBuilder::orderBy($column, $order)

Repeat call of this method, add a new order ; you can reset orders with method QueryBuilder::resetOrder().

A shortcut is available if you want to do a random order:

QueryBuilder::random()

Limit

You can limit results with methods:

If you want reset limits, uses method QueryBuilder::resetLimit().

Assignments

For Insert/Update statements, you need to assign values with method :

QueryBuilder::assign($column, $value)

Repeat call of this method, add a new assignment to the statement ; you can reset assignments with method QueryBuilder::resetAssignments().

Or pass an associative array with column names and values:

QueryBuilder::assigns(array|StatementInterface $columnValues)

Jointures

Three methods are available to do jointures:

If you want reset jointures, uses method QueryBuilder::resetJoin().

Union

An Union class is available to make unions with select.

Union class is a StatementInterface, so refers to the related paragraph to use it.

Fetch results

3 methods to fetch result:

To known how use Generator, refers to the PHP documentation: https://www.php.net/manual/class.generator.php

Count results

A shortcut method is available in QueryBuilder class to count results.

This method reset columns, limit and order of query ; but don't modify the query builder, so you can continue to use it to get results for example.

Exists

A shortcut method is available in QueryBuilder class to do an exists query.

This method don't modify the query builder, so you can continue to use it to get results for example.

Insert / Update / Delete

Shortcut methods are available in QueryBuilder class to do an insert, an update or a delete.

These methods don't modify the query builder, so you can continue to use it to get results for example.


All versions of query with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
hectororm/connection Version v1.0.0-beta6
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 hectororm/query contains the following files

Loading the files please wait ....