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

Cascade clone for OneHasMany relationship #549

Closed
wants to merge 3 commits into from
Closed

Cascade clone for OneHasMany relationship #549

wants to merge 3 commits into from

Conversation

qwerin
Copy link
Contributor

@qwerin qwerin commented Dec 16, 2021

resolve #260

@hrach
Copy link
Member

hrach commented Dec 16, 2021

Thank you for the contribution. However, I do not plan to enhance current cloning mechanism.

I'd rather accept different approach - introducing a helper class ~ Nextras\Orm\Entity\Cloner that will accept the entity and will return a clone. Optionally it will accept other configuration parameters (or with multiple methods) to allow setting up the clone depth/allowance for hasMany relationships and so.

Would you be open to contribute this? Some test would be needed too.

@hrach
Copy link
Member

hrach commented Jan 23, 2022

Hi @qwerin, what do you think?

@qwerin
Copy link
Contributor Author

qwerin commented Jan 24, 2022

jo urcite to bude treba mit nejaky "Cloner" zkousel jsem neco udelat ale je treba dost zasahovat do entit a nejich dat napr. set id=null takze bude treba pridat par public funkci. Dale jsem narazil na rekuzivni klonovani, takze bude treba mit registr klonu ( a ten bud v entite jako promenou nebo Cloner v sobe pole nebo a to my prislo nejlepsi mozna by se klony mohli udrzovat v repozitarich. Jak bude cas tak to klidne zkusim napsat jako PR.

@hrach
Copy link
Member

hrach commented Mar 6, 2022

Closing as this implementation is not we aim for. Feel free open new PR with the discussed architecture.

@hrach hrach closed this Mar 6, 2022
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.

Cascade clone for OneHasMany relationship
2 participants