当前位置: 首页>>代码示例>>PHP>>正文


PHP StepExecution::incrementSummaryInfo方法代码示例

本文整理汇总了PHP中Akeneo\Bundle\BatchBundle\Entity\StepExecution::incrementSummaryInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP StepExecution::incrementSummaryInfo方法的具体用法?PHP StepExecution::incrementSummaryInfo怎么用?PHP StepExecution::incrementSummaryInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Akeneo\Bundle\BatchBundle\Entity\StepExecution的用法示例。


在下文中一共展示了StepExecution::incrementSummaryInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: write

 public function write(array $items)
 {
     foreach ($items as $product) {
         $this->productManager->save($product);
         $this->stepExecution->incrementSummaryInfo('save');
     }
 }
开发者ID:nidup,项目名称:pim-docs,代码行数:7,代码来源:ProductWriter.php

示例2: process

 public function process($item)
 {
     $sku = (string) $item['sku'];
     $attribute = $this->productManager->getIdentifierAttribute();
     $product = $this->productManager->findByIdentifier($sku);
     // if (!$product) {
     //     $product = $this->productManager->createProduct();
     //     $value   = $this->productManager->createProductValue();
     //     $value->setAttribute($attribute);
     //     $value->setData($sku);
     //     $product->addValue($value);
     //     $this->stepExecution->incrementSummaryInfo('create');
     //     return $product;
     // } else {
     if (!$product) {
         $data = current((array) $item);
         $this->stepExecution->incrementSummaryInfo('skip');
         throw new InvalidItemException(sprintf('Skip the existing %s product', $sku), $data);
     } else {
         $product_tab = array();
         $product_tab[] = $product;
         $this->productUpdater->setValue($product_tab, 'price', [['data' => (string) $item['price'], 'currency' => (string) $item['currency']]]);
         return $product;
     }
     // }
 }
开发者ID:Ragoupady,项目名称:akeneo-rag,代码行数:26,代码来源:ProductProcessor.php

示例3: incrementCount

 /**
  * @param object $item
  */
 protected function incrementCount($item)
 {
     if ($item->getId()) {
         $this->stepExecution->incrementSummaryInfo('update');
     } else {
         $this->stepExecution->incrementSummaryInfo('create');
     }
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:11,代码来源:Writer.php

示例4:

 function it_increments_summary_info(StepExecution $stepExecution, ProductInterface $product1, ProductInterface $product2)
 {
     $product1->getId()->willReturn('45');
     $product2->getId()->willReturn(null);
     $stepExecution->incrementSummaryInfo('update')->shouldBeCalled();
     $stepExecution->incrementSummaryInfo('create')->shouldBeCalled();
     $this->setStepExecution($stepExecution);
     $this->write([$product1, $product2]);
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:9,代码来源:ProductWriterSpec.php

示例5: write

 public function write(array $items)
 {
     if (null === $this->file) {
         $this->file = new \SplFileObject($this->filePath, "w");
     }
     foreach ($items as $product) {
         $this->file->fputcsv($product);
         $this->stepExecution->incrementSummaryInfo('write');
     }
 }
开发者ID:Ragoupady,项目名称:akeneo-rag,代码行数:10,代码来源:ProductWriter.php

示例6: incrementCount

 /**
  * @param array $objects
  */
 protected function incrementCount(array $objects)
 {
     foreach ($objects as $object) {
         if ($object->getId()) {
             $this->stepExecution->incrementSummaryInfo('process');
         } else {
             $this->stepExecution->incrementSummaryInfo('create');
         }
     }
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:13,代码来源:BaseWriter.php

示例7: read

 /**
  * {@inheritdoc}
  */
 public function read()
 {
     if (!$this->cursor) {
         $this->cursor = $this->getQuery()->iterate();
     }
     if ($data = $this->cursor->next()) {
         $this->stepExecution->incrementSummaryInfo('read');
         return $data;
     }
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:13,代码来源:CursorReader.php

示例8: read

 /**
  * {@inheritdoc}
  */
 public function read()
 {
     if (null === $this->results) {
         $items = $this->readItems();
         $this->results = new \ArrayIterator($items);
     }
     if (null !== ($result = $this->results->current())) {
         $this->results->next();
         $this->stepExecution->incrementSummaryInfo('read');
     }
     return $result;
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:15,代码来源:AbstractReader.php

示例9: read

 /**
  * {@inheritdoc}
  */
 public function read()
 {
     if (!$this->isExecuted) {
         $this->isExecuted = true;
         $this->results = $this->getResults();
     }
     if (null !== ($result = $this->results->current())) {
         $this->results->next();
         $this->stepExecution->incrementSummaryInfo('read');
     }
     return $result;
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:15,代码来源:CategoryReader.php

示例10: read

 public function read()
 {
     if (!isset($this->iterator)) {
         $this->initializeIterator();
     }
     if (!$this->iterator->valid()) {
         return null;
     }
     $current = $this->iterator->current();
     if ($this->stepExecution) {
         $this->stepExecution->incrementSummaryInfo('read');
     }
     $this->iterator->next();
     return $current;
 }
开发者ID:antoineguigan,项目名称:ExcelConnectorBundle,代码行数:15,代码来源:AbstractIteratorReader.php

示例11: read

 public function read()
 {
     if (!isset($this->iterator)) {
         $this->initializeIterator();
     }
     if (!$this->iterator->valid()) {
         return null;
     }
     $current = $this->iterator->current();
     if ($this->stepExecution) {
         $this->stepExecution->incrementSummaryInfo('read');
     }
     $this->iterator->next();
     return $this->convertNumericIdentifierToString($current);
 }
开发者ID:qrz-io,项目名称:ExcelConnectorBundle,代码行数:15,代码来源:AbstractIteratorReader.php

示例12: read

 /**
  * {@inheritdoc}
  */
 public function read()
 {
     if (null === $this->csv) {
         if (mime_content_type($this->filePath) === 'application/zip') {
             $this->extractZipArchive();
         }
         $this->csv = new \SplFileObject($this->filePath);
         $this->csv->setFlags(\SplFileObject::READ_CSV | \SplFileObject::READ_AHEAD | \SplFileObject::SKIP_EMPTY | \SplFileObject::DROP_NEW_LINE);
         $this->csv->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
         $this->fieldNames = $this->csv->fgetcsv();
     }
     $data = $this->csv->fgetcsv();
     if (false !== $data) {
         if ($data === array(null) || $data === null) {
             return null;
         }
         if ($this->stepExecution) {
             $this->stepExecution->incrementSummaryInfo('read');
         }
         if (count($this->fieldNames) !== count($data)) {
             throw new InvalidItemException('pim_base_connector.steps.csv_reader.invalid_item_columns_count', $data, array('%totalColumnsCount%' => count($this->fieldNames), '%itemColumnsCount%' => count($data), '%csvPath%' => $this->csv->getRealPath(), '%lineno%' => $this->csv->key()));
         }
         $data = array_combine($this->fieldNames, $data);
     } else {
         throw new \RuntimeException('An error occured while reading the csv.');
     }
     return $data;
 }
开发者ID:NoelCamille,项目名称:pim-community-dev,代码行数:31,代码来源:CsvReader.php

示例13: read

 /**
  * {@inheritdoc}
  */
 public function read()
 {
     $configuration = $this->getJobConfiguration();
     if (!$this->isExecuted) {
         $this->isExecuted = true;
         $this->families = $this->getFamilies($configuration['filters']);
     }
     $result = $this->families->current();
     if (!empty($result)) {
         $this->stepExecution->incrementSummaryInfo('read');
         $this->families->next();
     } else {
         $result = null;
     }
     return $result;
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:19,代码来源:FilteredFamilyReader.php

示例14: setItemErrors

 /**
  * Sets errors on items
  *
  * @param array $item
  * @param array $errors
  *
  * @throws InvalidItemException
  */
 protected function setItemErrors(array $item, array $errors)
 {
     if ($this->stepExecution) {
         $this->stepExecution->incrementSummaryInfo('skip');
     }
     throw new InvalidItemException(implode("\n", $this->getErrorMessages($errors)), $item);
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:15,代码来源:TransformerProcessor.php

示例15: incrementSkippedProductsCount

 /**
  * @param int   $nbSkippedProducts
  * @param array $skippedMessages
  */
 protected function incrementSkippedProductsCount($nbSkippedProducts, $skippedMessages)
 {
     $this->stepExecution->incrementSummaryInfo('skip_products', $nbSkippedProducts);
     foreach ($skippedMessages as $productIdentifier => $messages) {
         $this->stepExecution->addWarning($this->getName(), sprintf('Copy of values to product "%s" skipped.', $productIdentifier), [], $messages);
     }
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:11,代码来源:VariantGroupWriter.php


注:本文中的Akeneo\Bundle\BatchBundle\Entity\StepExecution::incrementSummaryInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。