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

Feature/tree root #1877

Merged
merged 9 commits into from
Mar 4, 2018
Merged

Conversation

delboy1978uk
Copy link
Contributor

image

Now I have set @Gedmo\TreeRoot(identifierMethod="getMenu"), so it can restrict and renumber by the rows with a menu_id of x (the real tree root, a row in another table).

After running the repository method moveUp(7) (the action movie category, in the above example, third out of 3 movie categories), instead of an exception being thrown, now we get:

image

fix operator precedence

remove debug info

update repository to use identifierMethod for TreeRoot

fix parenthesis
@delboy1978uk
Copy link
Contributor Author

delboy1978uk commented Feb 10, 2018

Oh yeah, i also changed to PSR-4, and moved the source code to the src/ folder standard, which won't affect anything :-)
[EDIT] which I've just realised makes reviewing this code harder. I'll update this on Monday and undo the change from PSR-0, force push and it should be clearer. PSR-4 can go in a fresh ticket :-P

@delboy1978uk
Copy link
Contributor Author

I tidied up the pull request, code is back in the lib folder so you should be able to review changes easily now :-)

@l3pp4rd
Copy link
Contributor

l3pp4rd commented Feb 15, 2018

yes, I would not accept the lib to src change since that would involve BC breaks, since some mapping was directly referenced to directories on configuration for some projects.

could you also add a unit test for this new feature?

@delboy1978uk
Copy link
Contributor Author

Yeah sure, I can't do it today, but I'll work on it and give you another shout. Regarding the lib folder, we are now on PSR-4 anyway 😃 (just not in src/)

@delboy1978uk
Copy link
Contributor Author

Hi @l3pp4rd I have tested the new functionality and updated the tree.md docs :-)

@l3pp4rd
Copy link
Contributor

l3pp4rd commented Mar 4, 2018

thanks for all the effort, hope it will be useful for all users ;)

@chiqui3d
Copy link

chiqui3d commented Sep 8, 2018

Hello, I don't see any example in the documentation about having several root, I want to make a system as Wordpress has, what is called Taxonomy, I have seen that in Laravel there are many libraries, but in Symfony none :(

@delboy1978uk delboy1978uk deleted the feature/tree-root branch September 10, 2018 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants