Esempio n. 1
0
 /**
  * @param \Spryker\Zed\Collector\Business\Exporter\Writer\Storage\TouchUpdaterSet $touchUpdaterSet
  * @param int $idLocale
  * @param \Propel\Runtime\Connection\ConnectionInterface|null $connection
  *
  * @return void
  */
 public function bulkDelete(TouchUpdaterSet $touchUpdaterSet, $idLocale, ConnectionInterface $connection = null)
 {
     $idsToDelete = [];
     foreach ($touchUpdaterSet->getData() as $key => $touchData) {
         $idTouch = $touchData[CollectorConfig::COLLECTOR_TOUCH_ID];
         if ($idTouch !== null) {
             $idsToDelete[$idTouch] = $idTouch;
         }
     }
     if (!empty($idsToDelete) && $connection !== null) {
         $sql = $this->bulkTouchDeleteQuery->addQuery($this->touchKeyTableName, static::FK_TOUCH, $idsToDelete)->getRawSqlString();
         $this->bulkTouchDeleteQuery->flushQueries();
         $connection->exec($sql);
     }
 }
Esempio n. 2
0
 /**
  * @param \Spryker\Zed\Collector\Business\Exporter\Writer\Storage\TouchUpdaterSet $touchUpdaterSet
  * @param string $collectorKey
  * @param int $touchId
  * @param array $data
  *
  * @return void
  */
 protected function appendTouchUpdaterSetItem(TouchUpdaterSet $touchUpdaterSet, $collectorKey, $touchId, array $data)
 {
     $touchUpdaterSet->add($collectorKey, $touchId, [CollectorConfig::COLLECTOR_STORAGE_KEY => $this->getCollectorStorageKeyId($data), CollectorConfig::COLLECTOR_SEARCH_KEY => $this->getCollectorSearchKeyId($data)]);
 }
 /**
  * @return \Spryker\Zed\Collector\Business\Exporter\Writer\Storage\TouchUpdaterSet
  */
 protected function createTouchUpdaterSet()
 {
     $touchUpdaterSet = new TouchUpdaterSet('collector_touch_id');
     $touchUpdaterSet->add('data_key1', 'id_touch1', ['collector_touch_id' => 'touch_id', 'touchKeyColumnName_value' => 'new value']);
     $touchUpdaterSet->add('data_key2', 'id_touch2', ['collector_touch_id' => 'touch_id2', 'touchKeyColumnName_value' => 'new value2']);
     return $touchUpdaterSet;
 }