# |
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 |
# |
Nov 6th 2019, 00:50 |
daniel.upshaw |
Ah got it! |
# |
Nov 6th 2019, 00:47 |
dereuromark |
phinx sure also could need some love, after all migrations depends on that directly. |
# |
Nov 6th 2019, 00:47 |
daniel.upshaw |
And if so, wonder why |
# |
Nov 6th 2019, 00:46 |
daniel.upshaw |
I hope it's not losing too much steam |
# |
Nov 6th 2019, 00:46 |
daniel.upshaw |
Okay got it |
# |
Nov 6th 2019, 00:45 |
dereuromark |
if there is no current commits, most likely no one currently is |
# |
Nov 6th 2019, 00:43 |
daniel.upshaw |
Is there some place to find out if anyone's currently working on [x feature] though? |
# |
Nov 6th 2019, 00:43 |
daniel.upshaw |
Ah alright |
# |
Nov 6th 2019, 00:43 |
dereuromark |
you can just PR towards 4.x branch there |
# |
Nov 6th 2019, 00:39 |
daniel.upshaw |
Hoping to get an idea of the push on `4.x` and where it's feasible to contrib etc |
# |
Nov 6th 2019, 00:39 |
daniel.upshaw |
And `bin/cake migrations create` doesn't do it (yet) |
# |
Nov 6th 2019, 00:38 |
daniel.upshaw |
But that's the output I have in `bin/cake --help` |