-
Notifications
You must be signed in to change notification settings - Fork 114
[69364] Feature: Repository responsibility of children nodes removal #112
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
[69364] Feature: Repository responsibility of children nodes removal #112
Conversation
Internal ticket DEV-69364 |
@lbajsarowicz could you please proceed with the requested changes? |
@lbajsarowicz any updates? |
…moval' into feature/repository-node-removal
…-node-removal # Conflicts: # Model/MenuRepository.php
@lbajsarowicz could you merge current develop into your branch, please? |
* @return \Magento\Framework\Controller\ResultInterface|ResponseInterface | ||
* @throws \Magento\Framework\Exception\NotFoundException | ||
* @return ResultInterface|ResponseInterface | ||
* @throws NotFoundException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this exception (NotFoundException
) thrown? I see only CouldNotDeleteException
, InvalidArgumentException
, NoSuchEntityException
.
try { | ||
$id = $this->getRequestMenuId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The better name for this variable is $menuId
in my opinion.
@lbajsarowicz please proceed with the requested changes, then we'll review the code again and merge it to develop branch. Thank you! |
I don't have time to finish this. |
PR depends on #111
With this PR I removed the responsibility of removing children nodes from Controller, to Repository.
Controller's only responsibility should be navigating to the right resource / service to handle the request. Thus, there should be no business logic in Controller.
That is why I extracted this responsibility to Repository that responsibility is to maintain resources.
Also: replaced some weird "magic" behind the filtering with simple collection filter.