Download the PHP package shipmonk/doctrine-entity-preloader without Composer

On this page you can find all versions of the php package shipmonk/doctrine-entity-preloader. 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-entity-preloader

Doctrine Entity Preloader

shipmonk/doctrine-entity-preloader is a PHP library designed to tackle the n+1 query problem in Doctrine ORM by efficiently preloading related entities. This library offers a flexible and powerful way to optimize database access patterns, especially in cases with complex entity relationships.

Comparison

Default Manual Fetch Join setFetchMode EntityPreloader
OneToMany :red_circle: 1 + n :green_circle: 2 :orange_circle: 1, but
duplicate rows
:green_circle: 2 :green_circle: 2
OneToManyDeep :red_circle: 1 + n + n² :green_circle: 3 :orange_circle: 1, but
duplicate rows
:red_circle: 2 + n² :green_circle: 3
OneToManyAbstract :red_circle: 1 + n + n² :orange_circle: 3, but
duplicate rows
:orange_circle: 1, but
duplicate rows
:red_circle: 2 + n² :orange_circle: 3, but
duplicate rows
ManyToOne :red_circle: 1 + n :green_circle: 2 :orange_circle: 1, but
duplicate rows
:green_circle: 2 :green_circle: 2
ManyToOneDeep :red_circle: 1 + n + n :green_circle: 3 :orange_circle: 1, but
duplicate rows
:red_circle: 2 + n :green_circle: 3
ManyToMany :red_circle: 1 + n :green_circle: 2 :orange_circle: 1, but
duplicate rows
:red_circle: 1 + n :green_circle: 2

Comparison vs. Manual Preload

Unlike manual preload, the EntityPreloader does not require writing custom queries for each association.

Comparison vs. Fetch Join

Unlike fetch joins, the EntityPreloader does not fetches duplicate data, which slows down both the query and the hydration process, except when necessary to prevent additional queries fired by Doctrine during hydration process.

The fetch join scales poorly with the number of associations. With every preloaded association, the number of duplicate rows grows. The EntityPreloader does not have this problem.

Comparison vs. setFetchMode

Unlike Doctrine\ORM\AbstractQuery::setFetchMode it can

Installation

To install the library, use Composer:

Usage

Below is a basic example demonstrating how to use EntityPreloader to preload related entities and avoid the n+1 problem:

Configuration

EntityPreloader allows you to adjust batch sizes and fetch join limits to fit your application's performance needs:

Limitations


All versions of doctrine-entity-preloader with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/orm Version ^2.19.7 || ^3.2
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 shipmonk/doctrine-entity-preloader contains the following files

Loading the files please wait ....