Log message #4212434

# At Username Text
# Nov 6th 2019, 08:31 conehead @admad Yes thanks. That works. Just wondering if this example is not a little bit confusing then: https://book.cakephp.org/3/en/orm/saving-data.html#saving-belongsto-associations Something similar like `_ids` would be great I think
# Nov 6th 2019, 08:28 pidlo something like this? $query->func()->dateAdd('dfrom', @num, 'MONTH') ???
# Nov 6th 2019, 08:28 pidlo howto do this 'DATE_ADD(dfrom, INTERVAL - @num MONTH)'
# Nov 6th 2019, 08:28 pidlo hello all i have registred variable in sql '@num:=CAST(period AS UNSIGNED)',
# Nov 6th 2019, 08:26 admad @conehead to associate with existing record just set the foreign key, `attachement_id` in your case
# Nov 6th 2019, 08:24 scuadra Hello everyone. In Cake 3 is it possible to define the fields to be fetched in belongsTo association in the initialize() method?
# Nov 6th 2019, 08:21 conehead Still thinks that the created entity is "new". Doesn't seem to recognize the id
# Nov 6th 2019, 08:21 conehead Good morning
# Nov 6th 2019, 08:20 rudy1976s good morning to all !!!
# Nov 6th 2019, 08:18 conehead Hm I'll give it a shot. But it is not a new entity and it works with other `belongs to many` without `associated` as well
# Nov 6th 2019, 08:16 dereuromark Uppercase first char usually as those are the model names.
# Nov 6th 2019, 08:14 karmicdice `'associated' => ['attachments']`
# Nov 6th 2019, 08:14 karmicdice maybe parameter 2 should be `'associated'` ?
# Nov 6th 2019, 08:13 conehead All I want to do is save an association. It even saves null, when I do ``` $attachment = $this->Attachments->get(1); $post = $this->Posts->newEntity([ 'name' => 'newPost', 'attachment' => $attachment, ]);
# Nov 6th 2019, 08:11 karmicdice I reckon, it saves a null when you do not add an attachment? For situations like these, have you considered writing a behaviour and utilizing `beforeSave()`. What is the exact scenario and what are you trying to achieve?
# Nov 6th 2019, 08:10 conehead according to this: https://book.cakephp.org/3/en/orm/saving-data.html#saving-belongsto-associations it should work just fine
# Nov 6th 2019, 08:09 slackebot1 association. Just says `null`. If I set the `attachment_id` manually in the `posts` table, I can load the data with `contain` just fine.
# Nov 6th 2019, 08:09 conehead What could be the reason my existing `belongsTo` association is not saved? I have an existing association that works for reading data. When I try ``` $post = $this->Posts->newEntity([ 'name' => 'newPost', 'attachment' => [ 'id' => 1 // my existing attachment ] ]); ``` Always thinks that it is a new attachment instead of using the existing one. Even loading the attachment in a variable and set it explicitly does not save the
# Nov 6th 2019, 07:53 kgb.acct.personal Don't forget to put `use App\Constant\FileTypes;`
# Nov 6th 2019, 07:53 karmicdice or outside using what @kgb.acct.personal suggested.
# Nov 6th 2019, 07:52 karmicdice using self::
# Nov 6th 2019, 07:52 kgb.acct.personal FileTypes::IMAGE
# Nov 6th 2019, 07:50 markwendelson how will i use this constant in my controller?
# Nov 6th 2019, 07:46 javier.villanueva morning
# Nov 6th 2019, 07:43 markwendelson good day!
# Nov 6th 2019, 07:07 alexdd55976 morning
# Nov 6th 2019, 07:04 jotpe Morning
# Nov 6th 2019, 06:51 conehead Yeh, was a true pain in the ass. But good to know!
# Nov 6th 2019, 06:49 admad Cake doesn't have any such "compiled" code
# Nov 6th 2019, 06:42 conehead Don't need typed properties in core (yet) ;) But absolutely love the idea
# Nov 6th 2019, 06:42 conehead Had problems once with another framework. Couldn't use type hints because somewhere the code was "compiled", but without the typehints. This resulted in errors
# Nov 6th 2019, 06:19 admad you can do whatever you want in your app code. Can't add typed properties in 3.x core and it needs to support older php versions
# Nov 6th 2019, 05:58 conehead Any1 tried cake 3.x with php 7.4 already? Would be so glad to use typed properties
# Nov 6th 2019, 03:13 liaogz82 any examples I can look up to?
# Nov 6th 2019, 03:13 liaogz82 I need to mock a local S3 server for a cakephp bash job
# Nov 6th 2019, 03:12 liaogz82 hi guys
# Nov 6th 2019, 02:25 daniel.upshaw Anyone using Cake 4 in production?
# Nov 6th 2019, 00:51 daniel.upshaw And thank you for the info @dereuromark
# Nov 6th 2019, 00:51 daniel.upshaw Will look into another time
# Nov 6th 2019, 00:51 daniel.upshaw Lol interestingly this: `bin/cake bake migration_diff TableName` Is still recognized as a command, but it's not listed... will have to dig further soon... I'm just getting started with v4 today
# Nov 6th 2019, 00:50 daniel.upshaw Makes sense