Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve fatal error in repository generator #10601

Merged
merged 3 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/code/Magento/Bundle/Model/OptionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function save(
}
} else {
if (!$existingOption->getOptionId()) {
throw new NoSuchEntityException('Requested option doesn\'t exist');
throw new NoSuchEntityException(__('Requested option doesn\'t exist'));
}

$option->setData(array_merge($existingOption->getData(), $option->getData()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ protected function _getGetMethod()
/** @var ParameterReflection $parameterReflection */
$parameterReflection = $methodReflection->getParameters()[0];
$body = "if (!\$id) {\n"
. " throw new \\" . InputException::class . "('ID required');\n"
. " throw new \\" . InputException::class . "(__('ID required'));\n"
. "}\n"
. "if (!isset(\$this->registry[\$id])) {\n"
. " \$entity = \$this->" . $this->_getSourcePersistorPropertyName()
. "->loadEntity(\$id);\n"
. " if (!\$entity->getId()) {\n"
. " throw new \\" . NoSuchEntityException::class . "('Requested entity doesn\\'t exist');\n"
. " throw new \\" . NoSuchEntityException::class . "(__('Requested entity doesn\\'t exist'));\n"
. " }\n"
. " \$this->registry[\$id] = \$entity;\n"
. "}\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ class SampleRepository implements SampleRepositoryInterface
public function get($id)
{
if (!$id) {
throw new \Magento\Framework\Exception\InputException('ID required');
throw new \Magento\Framework\Exception\InputException(__('ID required'));
}
if (!isset($this->registry[$id])) {
$entity = $this->sampleInterfacePersistor->loadEntity($id);
if (!$entity->getId()) {
throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist');
throw new \Magento\Framework\Exception\NoSuchEntityException(__('Requested entity doesn\'t exist'));
}
$this->registry[$id] = $entity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ class TSampleRepository implements TSampleRepositoryInterface
public function get(int $id) : \Magento\Framework\ObjectManager\Code\Generator\TSampleInterface
{
if (!$id) {
throw new \Magento\Framework\Exception\InputException('ID required');
throw new \Magento\Framework\Exception\InputException(__('ID required'));
}
if (!isset($this->registry[$id])) {
$entity = $this->tSampleInterfacePersistor->loadEntity($id);
if (!$entity->getId()) {
throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist');
throw new \Magento\Framework\Exception\NoSuchEntityException(__('Requested entity doesn\'t exist'));
}
$this->registry[$id] = $entity;
}
Expand Down