Log message #4055512

# At Username Text
# Jul 21st 2017, 15:36 neon1024 You have to put a `->select()` into your contain :slightly_smiling_face:
# Jul 21st 2017, 15:36 gutts if I do something like $this->find()->contain()->select(['id' => 'id']) the relational fields go away. tried to specify them to no avail
# Jul 21st 2017, 15:35 gutts i'm selecting specific fields in my $this->find()->contains(['Table' => function($q) { } ]) expressions, but I also want my main model to selectively select certain fields. how can I "retain" my relational selects?
# Jul 21st 2017, 15:35 neon1024 @inoas I’m sure we talked about this before and you had something right?
# Jul 21st 2017, 15:35 neon1024 Does anyone have anything more elegant than this? https://pastebin.com/PEtq3zTT
# Jul 21st 2017, 15:11 jeremyharris next cakefest for sure. keep having things come up that interrupt them
# Jul 21st 2017, 15:10 neon1024 Will have to get you a beer at Cakefest :beer:
# Jul 21st 2017, 15:10 jeremyharris no problem :slightly_smiling_face:
# Jul 21st 2017, 15:10 neon1024 Thanks for all the help @jeremyharris I appreciate it :slightly_smiling_face:
# Jul 21st 2017, 15:08 jeremyharris @neon1024 yes
# Jul 21st 2017, 15:08 bernat I'll do a PR and see what comments I get.
# Jul 21st 2017, 15:08 jeremyharris or, perhaps, remove the post data example (marshaling) from the one in the saving entities section, and remove the entity example from the other one
# Jul 21st 2017, 15:08 bernat yes, I'll do now that I have some kind of confirmation. thanks!
# Jul 21st 2017, 15:07 neon1024 So the first record is id 1?
# Jul 21st 2017, 15:07 neon1024 So am I right in assuming this is auto increment?
# Jul 21st 2017, 15:07 neon1024 https://github.com/cakephp/cakephp/blob/master/tests/Fixture/ArticlesFixture.php#L45
# Jul 21st 2017, 15:07 jeremyharris yeah it looks pretty duplicated. perhaps you can edit the doc?
# Jul 21st 2017, 15:06 bernat probably the section in my link should be removed because it seems to be already documented in your link
# Jul 21st 2017, 15:06 bernat doesn't it seem like there's something duplicated and outdated there?
# Jul 21st 2017, 15:05 jeremyharris yes, I think that might be wrong
# Jul 21st 2017, 15:05 jeremyharris sorry I got confused by all the examples, didn’t know which one you were looking at
# Jul 21st 2017, 15:05 jeremyharris I see
# Jul 21st 2017, 15:05 bernat that's the example I was referring to, sorry
# Jul 21st 2017, 15:05 bernat jeremyharris, please see the second code block in my link
# Jul 21st 2017, 15:04 bernat I'm not sure. To me the Tags example is wrong because it doesn assign the result of the newEntity call. There's no save in it, it's like the other example.
# Jul 21st 2017, 15:04 jeremyharris in the tags example, since the data is added to the entity manually (not via newEntity or patchEntity), you don’t need to tell the marshaler to include it when it’s building the entities
# Jul 21st 2017, 15:03 jeremyharris the tags one is what associated entities to *save*, while the courses example shows what data should be *patched*, that is, added to entities
# Jul 21st 2017, 15:00 bernat in the second example the associated models are just Tags, but in the first one it has to use Courses._joinData
# Jul 21st 2017, 14:59 bernat see the newEntity line
# Jul 21st 2017, 14:59 jeremyharris why what is different?
# Jul 21st 2017, 14:58 bernat jeremyharris, it's true, you've found it, but can someone tell me why is it different here? https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-data-to-the-join-table
# Jul 21st 2017, 14:54 jeremyharris bernat see: https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-additional-data-to-the-join-table
# Jul 21st 2017, 14:54 jay mirec Testing is easier than it looks
# Jul 21st 2017, 14:54 jeremyharris bernat _joinData is a special parameter that add items to the join table entity
# Jul 21st 2017, 14:53 jeremyharris subject isn’t even passed to the listener arguments
# Jul 21st 2017, 14:53 jeremyharris birdy247 so I had to look it up because I don’t use magic arguments, but everything after the first argument passed to the listener should be the data
# Jul 21st 2017, 14:53 mirec ok so I will try to write tests too. I think naming tables when baking migration snapshots would be nice feature, so I will code it
# Jul 21st 2017, 14:52 bernat It's weird using _joinData as a model name, also it's not documented and I don't remember having it used like this
# Jul 21st 2017, 14:51 jeremyharris it’s definitely worth learning
# Jul 21st 2017, 14:51 bernat Hi. Is this answer the correct one? https://stackoverflow.com/questions/32969433/cakephp-3-save-extra-data-in-join-table
# Jul 21st 2017, 14:51 neon1024 Great time to learn!