Skip to content

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
@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.

3 participants