Download the PHP package kabiroman/adaptive-entity-manager without Composer

On this page you can find all versions of the php package kabiroman/adaptive-entity-manager. 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 adaptive-entity-manager

Adaptive Entity Manager

CI

A flexible PHP package implementing the Doctrine ObjectManager interface for seamlessly managing entities across different data sources: SQL databases, REST APIs, GraphQL endpoints, etc., using pluggable adapters.

Overview

Adaptive Entity Manager (AEM) is a powerful entity management system that provides a unified interface for working with entities across multiple data sources. It implements Doctrine's ObjectManager interface while offering enhanced flexibility through its adapter-based architecture.

AEM is particularly useful when you rely on Doctrine DBAL (or similar) for connections and SQL/query building, but adopting full Doctrine ORM entity mapping is impractical—for example, when integrating several external or legacy databases with uneven schemas.

In hexagonal (ports and adapters) architectures, place AEM in the infrastructure adapters behind your application or domain repositories so persistence concerns do not leak into the core model.

Documentation: docs/README.md (guides for Doctrine, DDD, hexagonal architecture, and legacy migration).

Features

Recent Updates (v1.6.0)

Domain value objects (metadata) and VO-aware manager API

Earlier in v1.5.0 — Quality, CI, and tooling

Earlier in v1.5.0 — API and documentation

Earlier in v1.4.0 — Boolean value mapping

Requirements

Installation

Install the package via Composer:

Dependencies

Basic Usage

Key Components

Entity Manager

The core component that manages entity operations:

Repositories

Custom repositories for entity-specific operations:

Unit of Work

Tracks entity states and manages transactions:

Advanced Features

ValueObject Support

Adaptive Entity Manager provides built-in support for immutable Value Objects, allowing you to work with domain-specific types instead of primitive values.

Built-in ValueObjects

Basic Usage

Entity Configuration

Configure your entity metadata to use ValueObjects:

Custom ValueObjects

Create your own ValueObjects by implementing ValueObjectInterface:

For complete ValueObject documentation, see docs/VALUE_OBJECTS.md.

Custom Data Adapters

Create custom adapters for different data sources by implementing the appropriate interfaces in the DataAdapter namespace.

Event System

The Adaptive Entity Manager provides a flexible event system based on PSR-14, allowing you to hook into various stages of the entity lifecycle. This enables powerful extensibility and modularity, letting you execute custom logic before or after core entity operations.

Key Events:

Usage Example (Conceptual):

To listen to events, you would implement a PSR-14 compatible event listener. For example, using a simple event dispatcher (or your framework's own, like Symfony's EventDispatcher):

Data Adapter Example

The Adaptive Entity Manager allows you to create custom data adapters for different data sources. Here's a simple example of implementing a REST API data adapter for a User entity.

Basic Implementation

Usage Example

Here's how to use the custom data adapter with the Adaptive Entity Manager:

Key Features

Available Methods

Method Description
loadById() Fetches a single entity by its identifier
insert() Creates a new entity
update() Updates an existing entity
delete() Removes an entity
loadAll() Retrieves multiple entities with optional filtering
refresh() Reloads entity data from the data source

Helper Methods

The AbstractDataAdapter provides useful case conversion methods:

Tips

  1. Always handle data transformation between your storage format and entity format
  2. Implement proper error handling for API responses
  3. Use type hints and return types for better code reliability
  4. Consider implementing caching for frequently accessed data
  5. Follow RESTful conventions for API endpoints

Next Steps

Metadata Management

Comprehensive metadata handling for entity mapping and relationship management.

Metadata example

This metadata configuration provides:

Boolean value mapping

If your data source uses flags like Y|N, 0|1, or T|F, you can normalize them to PHP bool using the values option on a field with type => 'boolean' in your metadata:

Notes:

User entity class that this metadata would describe:

Entity Proxies

The system supports lazy loading through proxy objects, automatically generating proxy classes when needed.

Value Objects

The Adaptive Entity Manager provides powerful Value Object support for better domain modeling and type safety. Value Objects are immutable objects that are defined by their values rather than identity.

For detailed documentation on Value Objects, see docs/VALUE_OBJECTS.md.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This package is open-sourced software licensed under the MIT license.

Author

Support

For issues, questions, or contributions, please use the GitHub issue tracker.


All versions of adaptive-entity-manager with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/persistence Version ^3.0 || ^4.0
laminas/laminas-code Version ^4.0
psr/cache Version ^1.0 || ^2.0 || ^3.0
psr/container Version ^1.1 || ^2.0
psr/event-dispatcher Version ^1.0
symfony/cache Version ^6.0 || ^7.0
symfony/string Version ^6.0 || ^7.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 kabiroman/adaptive-entity-manager contains the following files

Loading the files please wait ...