本文整理汇总了PHP中Akeneo\Bundle\BatchBundle\Entity\StepExecution::addSummaryInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP StepExecution::addSummaryInfo方法的具体用法?PHP StepExecution::addSummaryInfo怎么用?PHP StepExecution::addSummaryInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Akeneo\Bundle\BatchBundle\Entity\StepExecution
的用法示例。
在下文中一共展示了StepExecution::addSummaryInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateEncoding
/**
* Validate that the file is correctly encoded in the provided charset.
*
* @throws \Pim\Bundle\BaseConnectorBundle\Exception\CharsetException
* @throws \Exception
*/
protected function validateEncoding()
{
$handle = fopen($this->filePath, 'r');
if (false === $handle) {
throw new \Exception(sprintf('Unable to read the file "%s".', $this->filePath));
}
$errors = [];
$lineNo = 0;
while (false !== ($line = fgets($handle)) && count($errors) < $this->maxErrors) {
$lineNo++;
if (false === iconv($this->charset, $this->charset, $line)) {
$errors[] = $lineNo;
}
}
fclose($handle);
if (count($errors) > 0) {
$message = count($errors) === $this->maxErrors ? sprintf('The first %s erroneous lines are %s.', $this->maxErrors, implode(', ', $errors)) : sprintf('The lines %s are erroneous.', implode(', ', $errors));
throw new CharsetException(sprintf('The file "%s" is not correctly encoded in %s. ', $this->filePath, $this->charset) . $message);
}
$this->stepExecution->addSummaryInfo('charset_validator.title', $this->charset . ' OK');
}
示例2: addSummaryInfo
/**
* {@inheritDoc}
*/
public function addSummaryInfo($key, $info)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'addSummaryInfo', array($key, $info));
return parent::addSummaryInfo($key, $info);
}
开发者ID:aml-bendall,项目名称:ExpandAkeneoApi,代码行数:8,代码来源:__CG__AkeneoBundleBatchBundleEntityStepExecution.php