<?php

namespace External\VarioBundle\Synchronizers;

class ProductCategorySynchronizer extends BaseSynchronizer
{
    protected static $type = 'otProductCategory';
    protected static $batch = 100;
    protected static $maxBatches = 50;

    protected $fields = [
        'ProductID' => 'item',
    ];

    public function getEshopID($objectID)
    {
        return $objectID;
    }

    public function syncItem($value, $productID)
    {
        if (empty($value)) {
            return;
        }

        $this->helper->addDelayedUpdate(
            $this->helper->trimVarioId($value),
            ProductSynchronizer::getType()
        );
    }

    protected function getObjectID($item)
    {
        return $item->Data->ProductID;
    }
}
