Skip to content

Commit 0ddea98

Browse files
author
Volodymyr Kublytskyi
authored
Merge pull request #3071 from magento-engcom/bulk_api_backport
[EngCom] Bulk API backport
2 parents cee874a + 7b94a57 commit 0ddea98

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Framework\Exception;
8+
9+
use Magento\Framework\Phrase;
10+
11+
/**
12+
* Exception thrown while processing bulk of entities
13+
*
14+
* @api
15+
*/
16+
class BulkException extends AbstractAggregateException
17+
{
18+
/**
19+
* @var array
20+
*/
21+
private $data;
22+
23+
/**
24+
* Exception thrown while processing bulk of entities
25+
*
26+
* It is capable of holding both successfully processed entities and failed entities.
27+
* Client can decide how to handle the information
28+
*
29+
* @param \Magento\Framework\Phrase $phrase
30+
* @param \Exception $cause
31+
* @param int $code
32+
*/
33+
public function __construct(Phrase $phrase = null, \Exception $cause = null, $code = 0)
34+
{
35+
if ($phrase === null) {
36+
$phrase = new Phrase('One or more input exceptions have occurred while processing bulk.');
37+
}
38+
parent::__construct($phrase, $cause, $code);
39+
}
40+
41+
/**
42+
* @param $data array
43+
*/
44+
public function addData($data)
45+
{
46+
$this->data = $data;
47+
}
48+
49+
/**
50+
* @return array
51+
*/
52+
public function getData()
53+
{
54+
return $this->data;
55+
}
56+
}

0 commit comments

Comments
 (0)