Download the PHP package seacommerce/mapper without Composer

On this page you can find all versions of the php package seacommerce/mapper. 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 mapper

Build Status License: MIT

Seacommerce Mapper

A mapper for PHP to map data between objects that's optimized for performance and validation.

Features

Installation

Why an automapper?

Having to deal with a big variety of data objects throughout the layers in your application, often requires a lot of copying of data between those data objects. Usually you find yourself calling a bunch of getters and setters in a row to go from one object to another and then again to go to the next layer (for example: Doctrine Entity > Domain object > Form/View and back again). This it typically where an automapper can save you a lot of manual coding by automatically mapping properties with a similar name for example.

For example, mapping between the following two data structures

Could be reduced from

To just

Why another mapper?

You might be wondering why this library exists since there are already (at least) three similar mapper libraries for PHP:

Although all of these libraries have their own strengths and features, none of them provide the features that I like to see in a mapper which are mainly validation and compilation (= performance).

Validation

Automatically mapping properties between objects removes a lot of manual work but does not make the process less prone to human errors. Typically, automappers map properties on a "best-effort" basis by only automatically mapping properties that exists on both sides. Non-matching properties on either side still need some manual configuration or will otherwise be simply ignored.

PHP does not have a language construct to point to classes and member names (like in C#) and therefore, configuring a mapping manually usualy involves refering to properties using their name in a string value. E.g.

This is where bugs enter your system if there is no check on the existence of the properties or will at least cause you some headaches if you don't detect the typo in an early stage.

Validation is an early warning system that will reduce the headachs when dealing with mappings by checking the existence of the properties and the types ahead of time.

Compilation

PHP provides multiple ways to read and write properties of an object:

An automapper would kinda lose it's value if we had to tell it what read/write method to use on the mapped objects so therefore, part of the "auto" in automapper includes some magic to figure out the right way to get/set the properties.

This magic comes with a performance price. Symfony provides the PropertyAccess component that makes it easier and faster (due to caching) but compiling the mapping to native php code with native performance would be better.

mark-gerarts/automapper-plus

Pro's

Con's

janephp/automapper

Pro's

Con's

idr0id/papper

Pro's

Con's

Examples


All versions of mapper with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
symfony/property-info Version ^4.2
phpdocumentor/reflection-docblock Version ^4.3
nikic/php-parser Version ^4.2
symfony/property-access Version ^4.2
symfony/cache Version ^4.2
symfony/event-dispatcher Version ^4.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 seacommerce/mapper contains the following files

Loading the files please wait ....