Download the PHP package oro-flex/doctrine-utils without Composer

On this page you can find all versions of the php package oro-flex/doctrine-utils. 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 doctrine-utils

Oro Doctrine Utils Component

Oro Doctrine Utils Component provides some useful classes meant to make using Doctrine components easier.

QueryHintResolver class

The Doctrine query hints more flexible.

Descriptions of the class methods are below:

SqlWalker and TranslatableSqlWalker Output SQL Walkers

Doctrine output walkers used to modify queries to be more vendor-optimized. TranslatableSqlWalker should be used instead of the Gedmo TranslationWalker.

Both walkers utilize DecoratedSqlWalkerTrait which is responsible for decoration of all SQL output walker calls with calls to OutputAstWalkerInterface before result building, and OutputResultModifierInterface after the result is ready. OutputAstWalkerInterface and OutputResultModifierInterface are added to the query with two hints HINT_AST_WALKERS and HINT_RESULT_MODIFIERS. These hints are automatically filled with an array of classes during container building. To add your own AST walker or Output Result Modifier to the decoration, use the oro_entity.sql_walker DI tag.

OutputAstWalkerInterface should be used to modify AST tree, but not to generate SQL. To change the resulting SQL, use OutputResultModifierInterface (it has access to AST but should not modify it).

Out-of-the-box, there are several Output Result modifiers registered:

PostgreSqlOrderByNullsOutputResultModifier - NULLs Sorting

One of the class goals is to align NULLs sorting logic for MySQL and PostgreSQL. By default when ASC sorting is performed NULLs are sorted first in MySQL and last in PostgreSQL. SqlWalker applies NULLS FIRST instruction for nullable columns when them appears in ORDER BY clause. For DESC sorting NULLS LAST instruction is applied as well.

This behavior may be turned off by setting special query hint HINT_DISABLE_ORDER_BY_MODIFICATION_NULLS

MySqlUseIndexOutputResultModifier - force to use index for MySQL

MySqlUseIndexOutputResultModifier provides functionality of specifying concrete indexes that should be used by MySQL. Indexes are fetched from query hint HINT_USE_INDEX

UnionOutputResultModifier - Union SELECT to a given query

UnionOutputResultModifier provides union functionality. Union is added to a placeholder which is saved under HINT_UNION_KEY. The value of UNION query is fetched from the HINT_UNION_VALUE

PreciseOrderByWalker class

The Doctrine tree walker that is used to modify ORDER BY clause of a query to make sure that records will be returned in the same order independent from a state of SQL server and from values of OFFSET and LIMIT clauses. This is achieved by adding the primary key column of the first root entity to the end of ORDER BY clause.

Example of usage:

TransactionWatcherInterface interface

Sometimes it is required to perform some work only after data are committed to the database. For instance, sending notifications to users or to external systems. In this case the TransactionWatcherInterface can be helpful.

To be able to register DBAL transaction watchers you need to register the AddTransactionWatcherCompilerPass compiler pass and class loader for the transaction watcher aware connection proxy in your application, for example:

QueryBuilderUtil class

Constructing DQL queries dynamically may make them vulnerable for injections. To be sure that data, passed ans field name or table alias is safe QueryBuilderUtil contains a set of methods: sprintf - should be as query safe replacement instead of sprintf checkIdentifier - when there is a need to safely pass variable into query as part of identifier getField - is a shortcut for QueryBuilderUtil::sprintf('%s.%s', $alias, $field)


All versions of doctrine-utils with dependencies

PHP Build Version
Package Version
Requires php Version ~7.4.14 || ~8.0.0
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 oro-flex/doctrine-utils contains the following files

Loading the files please wait ....