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

5.x: clarify deep marshalling #17547

Merged
merged 1 commit into from
Jan 19, 2024
Merged

5.x: clarify deep marshalling #17547

merged 1 commit into from
Jan 19, 2024

Conversation

LordSimal
Copy link
Contributor

As just discussed in Slack/Discord it is not clear, that these two method calls don't lead to the same result:

// works as expected
$entity = $this->patchEntity($entity, $data, ['associated' => ['First.Second', 'First.Third', 'First.Fourth']]);
// won't patch Second, Third and Four
$entity = $this->patchEntity($entity, $data, ['associated' => ['First' => ['Second', 'Third', 'Fourth']]]); 

One would image/expect that this array structure behaves the same as a e.g. contain() array structure but it doesn't.

This PR at least adjusts the docs generated for api.cakephp.org including 2 separate tests to make sure this actually works and to link to if someone has questions about it.

We should make this clearer in the Book as well

@markstory
Copy link
Member

One would image/expect that this array structure behaves the same as a e.g. contain() array structure but it doesn't.

Maybe we should make the formats the same?

@markstory markstory merged commit ffc0afd into 5.x Jan 19, 2024
11 of 12 checks passed
@markstory markstory deleted the 5.x-clarify-deep-marshalling branch January 19, 2024 15:01
@LordSimal
Copy link
Contributor Author

LordSimal commented Jan 19, 2024

Maybe we should make the formats the same?

In the long run, yes
I have added it to the 6.0 ideas

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.

None yet

2 participants