Download the PHP package ang3/doctrine-orm-batch-process without Composer

On this page you can find all versions of the php package ang3/doctrine-orm-batch-process. 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-orm-batch-process

Doctrine ORM Batch Component

Code Quality PHPUnit Tests Latest Stable Version Latest Unstable Version Total Downloads

This component helps you to deal with batch-processing in the context of Doctrine ORM transactions.

The main problem with bulk operations is usually not to run out of memory and this is especially what the strategies presented here provide help with. -- Doctrine ORM documentation

The batch process component allows you to build bulk operations very easily with some advanced features.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Usage

A batch process is a basic loop using an iterator to do some logic with a handler. The iterator is mandatory and the handler is optional.

In all cases, the entity manager is flushed and cleared when the buffer size is reached (by default: 20).

Create a process

To create a process, use the constructor with the entity manager and an iterator, or use one of defined static shortcut methods as to your needs:

To execute the process:

Advanced options

This component provides some useful advanced options.

Handlers

A handler is a class implementing the interface . This class is called on each iteration. It allows you to persist/remove entities, or whatever you need with custom handlers.

This interface describes the method called by the batch process: .

The component provides some useful built-in handlers.

Persist entity handler

This handler persists entities into database.

Callable arguments:

  1. The entity
  2. The iteration.

Remove entity handler

This handler removes entities into database.

Callable arguments:

  1. The entity
  2. The iteration.

Callable handler

This handler holds a simple callable.

Callable arguments:

  1. Iterator data
  2. The iteration.

Chain handler

This handler allows you to chain handlers in a specific order.

Custom handler

Create a class implementing the interface .

Use the trait to enable options:

Buffer size

You can modify the default buffer size:

Disable ID generators

You can turn off the ID generator for one or more entities, useful to migrate data.

You can restore some disabled ID generators like below:

Transactional entities

The entity manager could be cleared many times. That's why during the process, all entities loaded before the execution will be detached from the manager.

To avoid reloading your entities, this component helps you to keep your entities in memory (by variable reference) in order to reload it automatically.

On flush

You can pass a callable to the batch to execute some logic on each flush/clear operations.

Callable arguments:

  1. The current batch
  2. The iteration (NULL in case of last flush/clear).

All versions of doctrine-orm-batch-process with dependencies

PHP Build Version
Package Version
Requires doctrine/orm Version ^2.12
php Version >=8.1
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 ang3/doctrine-orm-batch-process contains the following files

Loading the files please wait ....