PHPackages                             exeu/objectmerger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. exeu/objectmerger

ActiveLibrary

exeu/objectmerger
=================

Object Merger for PHP Objects.

0.3.0(11y ago)23.0k1[4 issues](https://github.com/Exeu/objectmerger/issues)Apache-2.0PHPPHP &gt;=5.3.0

Since Mar 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Exeu/objectmerger)[ Packagist](https://packagist.org/packages/exeu/objectmerger)[ Docs](https://github.com/Exeu/objectmerger)[ RSS](/packages/exeu-objectmerger/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (8)Used By (0)

\#Objectmerger

With this library you have the abillity to merge two objects of the same type.

This library is under construction. Things will change.

Build status
------------

[](#build-status)

[![Build Status](https://camo.githubusercontent.com/b2ba7663c2636e16f922b78d510de701641a055dfda614485ebea07406a56265/687474703a2f2f63692e706978656c2d7765622e6f72672f6a6f622f6f626a6563746d65726765722f62616467652f69636f6e)](http://ci.pixel-web.org/job/objectmerger/)

Installation
------------

[](#installation)

### Composer

[](#composer)

Add the objectmerger in your existing composer.json or create a new composer.json:

```
{
    "require": {
        "exeu/objectmerger": "dev-master"
    }
}
```

Now tell composer to download the library by running the command:

```
$ php composer.phar install
```

Composer will generate the autoloader file automaticly. So you only have to include this. Typically its located in the vendor dir and its called autoload.php

\##Basic Usage:

\###Adding mergeable metadata Before you can merge objects you have to add some metadata about which property should be mergeable. You can achieve this out of the box by three different ways: Annotations, YAML and XML.

\####Annotation

```
