File tree 4 files changed +14
-8
lines changed
app/code/Magento/Bundle/Model
lib/internal/Magento/Framework/ObjectManager
Test/Unit/Code/Generator/_files
4 files changed +14
-8
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 @@ -214,7 +214,7 @@ protected function _getDefaultConstructorDefinition()
214
214
/**
215
215
* Returns get() method
216
216
*
217
- * @return string
217
+ * @return array
218
218
*/
219
219
protected function _getGetMethod ()
220
220
{
@@ -223,13 +223,15 @@ protected function _getGetMethod()
223
223
/** @var ParameterReflection $parameterReflection */
224
224
$ parameterReflection = $ methodReflection ->getParameters ()[0 ];
225
225
$ body = "if (! \$id) { \n"
226
- . " throw new \\" . InputException::class . "('ID required'); \n"
226
+ . " throw new \\" . InputException::class . "(new \\ Magento \\ Framework \\ Phrase( 'ID required') ); \n"
227
227
. "} \n"
228
228
. "if (!isset( \$this->registry[ \$id])) { \n"
229
229
. " \$entity = \$this-> " . $ this ->_getSourcePersistorPropertyName ()
230
230
. "->loadEntity( \$id); \n"
231
231
. " if (! \$entity->getId()) { \n"
232
- . " throw new \\" . NoSuchEntityException::class . "('Requested entity doesn \\'t exist'); \n"
232
+ . " throw new \\" . NoSuchEntityException::class . "( \n"
233
+ . " new \\Magento \\Framework \\Phrase('Requested entity doesn \\'t exist') \n"
234
+ . " ); \n"
233
235
. " } \n"
234
236
. " \$this->registry[ \$id] = \$entity; \n"
235
237
. "} \n"
Original file line number Diff line number Diff line change @@ -67,12 +67,14 @@ class SampleRepository implements SampleRepositoryInterface
67
67
public function get($id)
68
68
{
69
69
if (!$id) {
70
- throw new \Magento\Framework\Exception\InputException('ID required');
70
+ throw new \Magento\Framework\Exception\InputException(new \Magento\Framework\Phrase( 'ID required') );
71
71
}
72
72
if (!isset($this->registry[$id])) {
73
73
$entity = $this->sampleInterfacePersistor->loadEntity($id);
74
74
if (!$entity->getId()) {
75
- throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist');
75
+ throw new \Magento\Framework\Exception\NoSuchEntityException(
76
+ new \Magento\Framework\Phrase('Requested entity doesn\'t exist')
77
+ );
76
78
}
77
79
$this->registry[$id] = $entity;
78
80
}
Original file line number Diff line number Diff line change @@ -67,12 +67,14 @@ class TSampleRepository implements TSampleRepositoryInterface
67
67
public function get(int $id) : \Magento\Framework\ObjectManager\Code\Generator\TSampleInterface
68
68
{
69
69
if (!$id) {
70
- throw new \Magento\Framework\Exception\InputException('ID required');
70
+ throw new \Magento\Framework\Exception\InputException(new \Magento\Framework\Phrase( 'ID required') );
71
71
}
72
72
if (!isset($this->registry[$id])) {
73
73
$entity = $this->tSampleInterfacePersistor->loadEntity($id);
74
74
if (!$entity->getId()) {
75
- throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist');
75
+ throw new \Magento\Framework\Exception\NoSuchEntityException(
76
+ new \Magento\Framework\Phrase('Requested entity doesn\'t exist')
77
+ );
76
78
}
77
79
$this->registry[$id] = $entity;
78
80
}
You can’t perform that action at this time.
0 commit comments