PHPackages                             gupalo/item-syncer - 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. [Database &amp; ORM](/categories/database)
4. /
5. gupalo/item-syncer

ActiveLibrary[Database &amp; ORM](/categories/database)

gupalo/item-syncer
==================

Item Syncer

1.4.0(7mo ago)15.9k↑242.9%1GPL-3.0-onlyPHPPHP &gt;=8.4CI passing

Since Jan 8Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/gupalo/item-syncer)[ Packagist](https://packagist.org/packages/gupalo/item-syncer)[ RSS](/packages/gupalo-item-syncer/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (4)Versions (13)Used By (0)

Item Syncer
===========

[](#item-syncer)

[![](https://camo.githubusercontent.com/0e8d72525a80917a9f2fbba561900b43afd59f4db21071c463ddce9ec8aeba14/687474703a2f2f706f7365722e707567782e6f72672f677570616c6f2f6974656d2d73796e6365722f76657273696f6e)](https://packagist.org/packages/gupalo/item-syncer)[![](https://camo.githubusercontent.com/971be83fe392d3d63d315c2465e6ac72d494a77f0ef3cb798021b237982d05eb/687474703a2f2f706f7365722e707567782e6f72672f677570616c6f2f6974656d2d73796e6365722f726571756972652f706870)](https://packagist.org/packages/gupalo/item-syncer)[![](https://camo.githubusercontent.com/9a2b592bc1d8b708ba3cf4e60ef9f9c6d85ffeb262cfd8a2302dfb2787ec48f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f677570616c6f2f6974656d2d73796e636572)](https://packagist.org/packages/gupalo/item-syncer)[![](https://camo.githubusercontent.com/68b9f74d61bcf79d6645cc0b9a90391652f76895dbb19e85068e41f3ecd01dd8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f677570616c6f2f6974656d2d73796e6365722f6d61696e)](https://camo.githubusercontent.com/68b9f74d61bcf79d6645cc0b9a90391652f76895dbb19e85068e41f3ecd01dd8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f677570616c6f2f6974656d2d73796e6365722f6d61696e)[![](https://camo.githubusercontent.com/ee32cf707cedfeb74d0b8ad1de777cb12064330eef9deae86195e5d014972b0d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f677570616c6f2f6974656d2d73796e6365722f746573742e79616d6c3f6272616e63683d6d61696e)](https://camo.githubusercontent.com/ee32cf707cedfeb74d0b8ad1de777cb12064330eef9deae86195e5d014972b0d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f677570616c6f2f6974656d2d73796e6365722f746573742e79616d6c3f6272616e63683d6d61696e)

Sync remote to local items.

Requires PHP 8.4+ and Doctrine ORM 3.0+.

Install
-------

[](#install)

```
composer require gupalo/item-syncer
```

How to use
----------

[](#how-to-use)

Create 2 arrays with items implementing `\Gupalo\ItemSyncer\SyncableEntityInterface`:

- `remoteItems`: usually from external API - source of truth
- `localItems`: items from your DB

Update logic:

- remote item that is missing locally - create
- remote item that exists locally - update (you implement logic which properties should be updated)
- local item that is missing remotely - you decide by selecting sync method:
    - `syncKeeping`: don't do anything
    - `syncArchiving`: if local item has method `archive` then archive local item
    - `syncRemoving`: remove local items

If you use Doctrine and save diff to database then use `DbItemSyncer`. If you have your own logic of processing diff then use ItemSyncer and its `diffKeeping`, `diffArchiving`, `diffRemoving` methods.

Example
-------

[](#example)

```
$remoteItems = array_map(
    static fn(array $a) => Country::createFromApi($a),
    $this->countryApiClient->getCountries()
);
$localItems = $this->countryRepository->findAll();
$diff = $this->dbItemSyncer->syncArchiving($remoteItems, $localItems);

print_r($diff->stat()); // something like ['created' => 2, 'updated' => 180]
```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance65

Regular maintenance activity

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~100 days

Recently: every ~274 days

Total

12

Last Release

211d ago

PHP version history (2 changes)1.0.0PHP ^8.1

1.4.0PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/df3e7060fb5777768e7bb133e98b1e7dfcc788f25fe6dc445acf7036da5c0c3e?d=identicon)[luchaninov](/maintainers/luchaninov)

---

Top Contributors

[![luchaninov](https://avatars.githubusercontent.com/u/3829796?v=4)](https://github.com/luchaninov "luchaninov (14 commits)")

---

Tags

doctrinesync

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gupalo-item-syncer/health.svg)

```
[![Health](https://phpackages.com/badges/gupalo-item-syncer/health.svg)](https://phpackages.com/packages/gupalo-item-syncer)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

12017.1k](/packages/rcsofttech-audit-trail-bundle)[api-platform/doctrine-orm

Doctrine ORM bridge

314.8M107](/packages/api-platform-doctrine-orm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
