rebelcode / entity-manager-interface
An interface package for standardizing entity managers.
Requires
- php: ^5.3.9 | ^7.0
- dhii/collections-interface: ^0.2-alpha4
- psr/container: ^1.0
Requires (Dev)
- codeclimate/php-test-reporter: <=0.3.2
- dhii/php-cs-fixer-config: dev-php-5.3
- dhii/stringable-interface: ^0.1
- phpunit/phpunit: ^4.8
- ptrofimov/xpmock: ^1.1
Suggests
- dhii/cqrs-resource-model-interface: Interfaces for building granular and flexible database abstraction
This package is auto-updated.
Last update: 2024-12-10 23:52:21 UTC
README
An interface package for standardizing entity managers.
Introduction
This package provides a set of interfaces for objects (referred to as entity managers) that can manage entities.
The interfaces are designed to mimic typical collection APIs in order to make them as compatible as possible with other collection implements.
In fact, some of the interfaces and methods in this package are inherited from dhii/collections-interface
. This is to allow entity managers
to be able to work with both fixed and temporary forms of entities, such as database records, temporary computation results or configuration.
We use these interfaces internally to conceal our usage of CQRS resource model abstraction from consumers (See dhii/cqrs-resource-model-interface
).
By implementing these interfaces, we are able to make consumers agnostic of this database abstraction and instead communicate with entity
manager instances for read/write operations.
Requirements
- PHP 5.3.9 or later
Installation
With composer (Recommended)
composer require rebelcode/entity-manager-interface
Custom Autoloader
Download the source code and refer to the vendor of your autoloader implementation for how to add an autoload rule.
All interfaces in this package exist under the RebelCode\Entity
namespace and are located within the src
directory, with no exceptions.
Without composer
Download the source code and require
or include
the required files in your code.
Each interface is stored in its own identically-named file without any consequential code being invoked, which means the files are 100% safe for inclusion.