Download the PHP package somnambulist/value-object-doctrine-mappings without Composer

On this page you can find all versions of the php package somnambulist/value-object-doctrine-mappings. 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 value-object-doctrine-mappings

Moved to https://github.com/dave-redfern/somnambulist-domain

This repository has been archived. Please update to the combined package.s

Doctrine Mappings for Value Objects and Enumerations

Provides a basic set of mapping information for the somnambulist/value-objects library for use with Doctrine. Mappings are available for Doctrine (.dcm.yml) and Symfony (.orm.yml). The mappings are symlinked from symfony to doctrine.

A Bootstrapper is included for automatically registering the value-object enumerations as Doctrine types.

Requirements

Installation

Install using composer, or checkout / pull the files from github.com.

Usage

Copy or link the mapping files to your project in the Doctrine configuration. These are needed per entity manager. It is highly recommended to extend the value-objects to your own and then copy and adapt the mappings as you need.

Remember: value-objects are part of your domain model and should be treated with care.

Note: enumerations are used in these mappings.

Register Enumeration Handlers

To register the enumeration handlers add the following to your applications bootstrap code (e.g.: AppBundle::boot or AppServiceProvider::register|boot):

Somnambulist\Doctrine\Bootstrapper::registerEnumerations();

This will pre-register the following enumerations:

In addition extra helpers are registered to allow the Country and Currency value objects to be used as enumerations. These are stored using the CountryCode and CurrencyCode values and restored using the ::create() method.

Register Custom Types

Custom types are included for:

The date types override the default Doctrine types and uses the VO DateTime that is an extended DateTimeImmutable object.

json, jsonb and json_collection are equivalent and allow JSON data to be converted to and from a Collection object instead of a plain array.

To register the types add the following to your application bootstrap:

Somnambulist\Doctrine\Bootstrapper::registerTypes();

Mapping Files

To use the types and enumerations, in your mapping files set the type appropriately:

To use the value-objects:

Or in XML format:

When using embeddables, be sure to have added the necessary mapping files.

Configuring Types for Symfony

Within a Symfony project, add a new mapping area to your orm configuration within the doctrine section:

Then either copy or symlink the appropriate config files from vendor config folder to your projects mapping config section. If you have different requirements for field type, copy and update as appropriate. It is recommended to copy and not link the mapping files to avoid issues with this library changing.

Links


All versions of value-object-doctrine-mappings with dependencies

PHP Build Version
Package Version
Requires php Version >7
doctrine/dbal Version ^2.5
somnambulist/doctrine-enum-bridge Version ~1.0
somnambulist/value-objects Version ~1.3
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 somnambulist/value-object-doctrine-mappings contains the following files

Loading the files please wait ....