Overview

Namespaces

  • Datadepo
    • Api
      • DataStores
      • Structures
      • Synchronizers

Classes

  • Datadepo\Api\ApiWrapper
  • Datadepo\Api\Collector
  • Datadepo\Api\DataDepoResponse
  • Datadepo\Api\DataDepoSync
  • Datadepo\Api\DataStores\PdoDataStore
  • Datadepo\Api\IniConfiguration
  • Datadepo\Api\RunningFiles
  • Datadepo\Api\Structures\AbstractStructure
  • Datadepo\Api\Structures\BusinessLine
  • Datadepo\Api\Structures\BusinessSupplierLine
  • Datadepo\Api\Structures\CategoryLine
  • Datadepo\Api\Structures\DataLine
  • Datadepo\Api\Structures\ImageLine
  • Datadepo\Api\Structures\ParameterLine
  • Datadepo\Api\Structures\PriceLine
  • Datadepo\Api\Structures\RelatedLine
  • Datadepo\Api\Structures\StoreLine
  • Datadepo\Api\Structures\SupplierBankAccountLine
  • Datadepo\Api\Structures\SupplierLine
  • Datadepo\Api\Structures\SupplierPersonLine
  • Datadepo\Api\Structures\VariantLine
  • Datadepo\Api\Synchronizers\AbstractSynchronizer
  • Datadepo\Api\Synchronizers\BusinessSynchronizer
  • Datadepo\Api\Synchronizers\CategorySynchronizer
  • Datadepo\Api\Synchronizers\DataSynchronizer
  • Datadepo\Api\Synchronizers\SuppliersSynchronizer

Interfaces

  • Datadepo\Api\DataStores\IDataStore

Exceptions

  • Datadepo\Api\ApiException
  • Datadepo\Api\ConfigurationException
  • Datadepo\Api\DataDepoRunningException
  • Datadepo\Api\DataDepoSuspendedException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: namespace Datadepo\Api\Synchronizers;
 3: use Datadepo\Api;
 4: 
 5: class SuppliersSynchronizer extends AbstractSynchronizer
 6: {
 7:   
 8:   /**
 9:    * @return Api\DataDepoResponse
10:    */
11:   protected function makeSync()
12:   {
13:     $config = $this->dataStore->getConfig('suppliers_last', 'suppliers_rows');
14:     return $this->callSync('suppliers', $config, $this->iniConfiguration->get('limits', 'suppliers'));
15:   }
16:   
17:   /**
18:    * @retrun Api\Structures\SupplierLine
19:    */
20:   protected function wrapLine($line)
21:   {
22:     return new Api\Structures\SupplierLine($line);
23:   }
24:   
25:   /**
26:    * @param Api\Collector $collector
27:    */
28:   protected function processChunk(Api\Collector $collector)
29:   {
30:     /* @var $temp Api\Structures\BusinessLine[] */
31:     $actual = $this->dataStore->getChecksums('suppliers', $collector->getPrimaryKeys());
32:     
33:     $this->dataStore->startChunkProcess();
34:     
35:     /* @var $line Api\Structures\BusinessLine */
36:     foreach ($collector as $code => $line) {
37:       if (!isset($actual[$code])) {
38:         $this->dataStore->insertRow($line);
39:       }
40:       elseif ($actual[$code] != $line->getChecksum()) {
41:         $this->dataStore->updateRow($line);
42:       }
43:     }
44:     $this->dataStore->endChunkProcess();
45:   }
46:   
47: }
API documentation generated by ApiGen