Download the PHP package zolex/vom without Composer

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

Versatile Object Mapper

Release Version Integration Code Coverage License Downloads

PHP Symfony Laravel

The Versatile Object Mapper - or in short VOM - is a PHP library to transform any data structure into strictly typed models, by simply adding PHP attributes to model classes.

Installation

VOM is available on packagist. To install, simply require it via composer.

Plain PHP

When installed via composer or as a download from the releases page, you are ready to use VOM without a framework.

Symfony

When using symfony, the package also integrates as a bundle. With flex and autoconfiguration there is nothing else to do. You are ready to use the VOM Symfony Service. For the best interoperability, VOM implements the Symfony normalizer and denormalizer interfaces.

Without autoconfiguration, or if you choose to not run symfony/flex recipe generation, you have to enable the bundle manually by adding it to config/bundles.php.

Laravel

VOM also comes with a Laravel Service Provider. After installing with composer, the VersatileObjectMapper class is registered for Dependency Injection and can also be accessed using app(), resolve() etc. See the example for VOM in Laravel.

Quickstart

To give you a basic idea of what VOM does, here is a first short example.

Given, your application receives the following flat array of values from somewhere.

Usually you would write some code that creates the model instances, sets their properties and nests them properly. In very simple scenarios, writing the transformation logic as code might be a good choice, but it can be a pain when it comes to very huge models, the input data structures and/or application models change while still in development, or if you want to reuse the transformation logic in other projects too, because it receives the same inputs and/or uses the same models.

How it works using VOM

Instead of writing business logic that feeds your models, with VOM you simply configure the models using PHP attributes.

To create instances of your models, you simply pass the data to the denormalize() method.

You may have noticed, that some property attributes have arguments while others don't. For all details on that, head to the full documentation.

Now, do I need this?

If there is any difference between the data structure of your input and your application's models, VOM may be a good choice to avoid writing and maintaining code, but instead just add some PHP attributes.

[!NOTE] If you need to inject data into your entities that already is in a structure matching your models, this library can be used but may be an overhead. In this scenario you could simply utilize a standard Symfony normalizer.

Documentation

The full documentation is available in the docs folder of this repository.

Examples

The example from the quickstart and more can be found in the VOM Examples repository.


All versions of vom with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
symfony/property-access Version ^6.2|^7.0
symfony/serializer Version ^6.4|^7.0
phpdocumentor/reflection-docblock Version ^5.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 zolex/vom contains the following files

Loading the files please wait ....