Download the PHP package datasage/laminas-doctrine-hydration-module without Composer

On this page you can find all versions of the php package datasage/laminas-doctrine-hydration-module. 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 laminas-doctrine-hydration-module

Repository abandoned

This repo has been updated to support PHP 7.4 and 8+ as well as converted to use Laminas packages. These upgrades where done to address a dependency with an upstream package.

Feel free to use it AS-IS, we won't be providing any support anymore.

Doctrine Hydration Module

Supported features

Make sure to commit on the correct branch if you want your changes to get merged into the project.

Installation

Add to composer.json

Add to application config

Hydrator configuration

entity_class

This property is used to specify the class of the entity that will be hydrated. You need to make sure that this entity is a mapped doctrine class.

object_manager

You can specify which object manager you want to use for the hydrator. The value is the key of the desired object manager in the service manager.

by_value

Specify if you want the hydrator to hydrate the entity by value or by reference.

use_generated_hydrator

This property will only be used with mongoDB ODM and will use the generated hydrators instead of the Doctrine Module Hydrator. Strategies will not work when this option is set to true.

naming_strategy

You can use a custom naming strategy for the hydrator. Specify the key of the naming strategy in the service manager. Note that this naming strategy needs to implement NamingStrategyInterface.

hydrator You can use a custom hydrator instead of the default DoctrineObject hydrator. Make sure this hydrator implements HydratorInterface.

strategies

It is possible to customize the hydration strategy of specific properties. Configure the property you want to customize with the key of the strategy in the service manager; Note that this strategy needs to implement StrategyInterface.

filters

This property can be used to apply filters on the Hydrator. You can specify a list of custom filters by defining the key of the filter in the service manager and the filter condition as described in the hydrator filter documentation. Note that this filter needs to implement FilterInterface.

From here on, you can get the hydrator by calling get('hydrator-manager-key') on the HydratorManager.

Custom strategies:

MongoDB ODM

Custom Filters

Custom filters allow you to fine-tune the results of the hydrator's extract functionality by determining which fields should be extracted.

To configure custom filters:

In this example configuration, the hydrator factory will retrieve custom.filter from the Service Manager and inject it as a filter into the hydrator. The filter must implement Zend\Hydrator\Filter\FilterInterface.

The service's filter($fieldName) function will be called by the hydrator during extract and the field name being extracted will be passed as an argument. The filter() function must return a truthy value: if true then the field will NOT be extracted.

Override hydrator:

If the standard DoctrineHydrator is not flexible enough, you can set a custom hydrator. This allows you to use an extended DoctrineHydrator or another existing hydrator, and configure it with this module. This setting will override use_generated_hydrator.

Testing

This package is fully tested with Cs fixer and PhpUnit. The MongoDB tests require mongodb to be installed on your machine. You can skip these tests by adding a testsuite to the command:


All versions of laminas-doctrine-hydration-module with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0 || ^8.1 || ^8.2
doctrine/persistence Version ^2.0.0 || ^3.0.0
doctrine/doctrine-module Version ^3.0.0 || ^4.0.0 || ^5.0.0
doctrine/instantiator Version ^1.0.5
laminas/laminas-servicemanager Version ^3.3.2
laminas/laminas-hydrator Version ^3.0.0 || ^4.0.0
doctrine/doctrine-laminas-hydrator Version ^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 datasage/laminas-doctrine-hydration-module contains the following files

Loading the files please wait ....