Skip to content

[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

Closed
wants to merge 9 commits into from
Closed

[69364] Feature: Repository responsibility of children nodes removal #112

wants to merge 9 commits into from

Conversation

lbajsarowicz
Copy link
Contributor

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.

@snowremi
Copy link

Internal ticket DEV-69364

@mcjwsk mcjwsk requested a review from rafdol August 21, 2020 09:17
@kiber
Copy link
Contributor

kiber commented Sep 22, 2020

@lbajsarowicz could you please proceed with the requested changes?

@kiber
Copy link
Contributor

kiber commented Sep 29, 2020

@lbajsarowicz any updates?

@andrzejborkowski andrzejborkowski changed the title Feature: Repository responsibility of children nodes removal [69364] Feature: Repository responsibility of children nodes removal Jan 21, 2021
@rafdol
Copy link

rafdol commented Jan 22, 2021

@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
Copy link

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();
Copy link

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.

@andrzejborkowski
Copy link

@lbajsarowicz please proceed with the requested changes, then we'll review the code again and merge it to develop branch. Thank you!

@lbajsarowicz
Copy link
Contributor Author

I don't have time to finish this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants