Download the PHP package gupalo/item-syncer without Composer
On this page you can find all versions of the php package gupalo/item-syncer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package item-syncer
Item Syncer
Sync remote to local items.
Install
How to use
Create 2 arrays with items implementing \Gupalo\ItemSyncer\SyncableEntityInterface
:
remoteItems
: usually from external API - source of truthlocalItems
: 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 anythingsyncArchiving
: if local item has methodarchive
then archive local itemsyncRemoving
: 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
All versions of item-syncer with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
doctrine/orm Version ^2.14
phpspec/prophecy-phpunit Version ^2.0
gupalo/dateutils Version ^1.13
doctrine/orm Version ^2.14
phpspec/prophecy-phpunit Version ^2.0
gupalo/dateutils Version ^1.13
The package gupalo/item-syncer contains the following files
Loading the files please wait ....