This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed
app/code/Magento/Bundle/Model
lib/internal/Magento/Framework/ObjectManager
Test/Unit/Code/Generator/_files Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ public function save(
208
208
}
209
209
} else {
210
210
if (!$ existingOption ->getOptionId ()) {
211
- throw new NoSuchEntityException ('Requested option doesn \'t exist ' );
211
+ throw new NoSuchEntityException (__ ( 'Requested option doesn \'t exist ' ) );
212
212
}
213
213
214
214
$ option ->setData (array_merge ($ existingOption ->getData (), $ option ->getData ()));
Original file line number Diff line number Diff line change @@ -226,13 +226,15 @@ protected function _getGetMethod()
226
226
/** @var ParameterReflection $parameterReflection */
227
227
$ parameterReflection = $ methodReflection ->getParameters ()[0 ];
228
228
$ body = "if (! \$id) { \n"
229
- . " throw new \\" . InputException::class . "('ID required'); \n"
229
+ . " throw new \\" . InputException::class . "(new \\ Magento \\ Framework \\ Phrase( 'ID required') ); \n"
230
230
. "} \n"
231
231
. "if (!isset( \$this->registry[ \$id])) { \n"
232
232
. " \$entity = \$this-> " . $ this ->_getSourcePersistorPropertyName ()
233
233
. "->loadEntity( \$id); \n"
234
234
. " if (! \$entity->getId()) { \n"
235
- . " throw new \\" . NoSuchEntityException::class . "('Requested entity doesn \\'t exist'); \n"
235
+ . " throw new \\" . NoSuchEntityException::class . "( \n"
236
+ . " new \\Magento \\Framework \\Phrase('Requested entity doesn \\'t exist') \n"
237
+ . " ); \n"
236
238
. " } \n"
237
239
. " \$this->registry[ \$id] = \$entity; \n"
238
240
. "} \n"
Original file line number Diff line number Diff line change @@ -71,12 +71,14 @@ class SampleRepository implements SampleRepositoryInterface
71
71
public function get($id)
72
72
{
73
73
if (!$id) {
74
- throw new \Magento\Framework\Exception\InputException('ID required');
74
+ throw new \Magento\Framework\Exception\InputException(new \Magento\Framework\Phrase( 'ID required') );
75
75
}
76
76
if (!isset($this->registry[$id])) {
77
77
$entity = $this->sampleInterfacePersistor->loadEntity($id);
78
78
if (!$entity->getId()) {
79
- throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist');
79
+ throw new \Magento\Framework\Exception\NoSuchEntityException(
80
+ new \Magento\Framework\Phrase('Requested entity doesn\'t exist')
81
+ );
80
82
}
81
83
$this->registry[$id] = $entity;
82
84
}
Original file line number Diff line number Diff line change @@ -71,12 +71,14 @@ class TSampleRepository implements TSampleRepositoryInterface
71
71
public function get(int $id) : \Magento\Framework\ObjectManager\Code\Generator\TSampleInterface
72
72
{
73
73
if (!$id) {
74
- throw new \Magento\Framework\Exception\InputException('ID required');
74
+ throw new \Magento\Framework\Exception\InputException(new \Magento\Framework\Phrase( 'ID required') );
75
75
}
76
76
if (!isset($this->registry[$id])) {
77
77
$entity = $this->tSampleInterfacePersistor->loadEntity($id);
78
78
if (!$entity->getId()) {
79
- throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist');
79
+ throw new \Magento\Framework\Exception\NoSuchEntityException(
80
+ new \Magento\Framework\Phrase('Requested entity doesn\'t exist')
81
+ );
80
82
}
81
83
$this->registry[$id] = $entity;
82
84
}
You can’t perform that action at this time.
0 commit comments