# |
Apr 29th 2017, 12:38 |
metoyoko |
@loginews is param is your actual table name? |
# |
Apr 29th 2017, 12:38 |
dereuromark |
there is a 4) option. |
# |
Apr 29th 2017, 12:38 |
bravo-kernel |
correct? |
# |
Apr 29th 2017, 12:38 |
bravo-kernel |
3) obfuscate the ints |
# |
Apr 29th 2017, 12:38 |
bravo-kernel |
2) use cake's UUID (all just works but 36, slow) |
# |
Apr 29th 2017, 12:37 |
bravo-kernel |
1) use ints (fast but not too handy, harvestable) |
# |
Apr 29th 2017, 12:37 |
bravo-kernel |
@dereuromark I see. So at this point in time I have three choices for my "valuable" ids: |
# |
Apr 29th 2017, 12:37 |
chris-andre |
@metoyoko It's well documented https://book.cakephp.org/3.0/en/orm/associations.html#belongstomany-associations |
# |
Apr 29th 2017, 12:36 |
dereuromark |
but fact is: I tried as well as others to raise awareness - and hoped someone would implement it for real :slightly_smiling_face: |
# |
Apr 29th 2017, 12:36 |
dereuromark |
dont know myself: https://github.com/cakephp/cakephp/issues/7013#issuecomment-121382943 - I tried it in early 3.0 days |
# |
Apr 29th 2017, 12:35 |
bravo-kernel |
no info on migrations, etc. |
# |
Apr 29th 2017, 12:35 |
bravo-kernel |
@dereuromark got a bit lost from there on. Not a clue how to approach it basically |
# |
Apr 29th 2017, 12:34 |
bravo-kernel |
@dereuromark I was re-reading earlier feedback, looked at your plugin readme again, took in the binary(16) advice and thought.... well, let's try it |
# |
Apr 29th 2017, 12:34 |
metoyoko |
how about hasMany and belongsToMany |
# |
Apr 29th 2017, 12:33 |
dereuromark |
bravo: concerning? what do you mean? |
# |
Apr 29th 2017, 12:33 |
bravo-kernel |
@cleptric right, hence my confusion about being advised to use binary(16) uuid :face_with_rolling_eyes: |
# |
Apr 29th 2017, 12:33 |
metoyoko |
thanks @chris-andre |
# |
Apr 29th 2017, 12:33 |
metoyoko |
belongsTo: The foreign key is in the same table (Managers has a department_id) hasOne: The foreign key is in the other table. (Department hasOne Manager) |
# |
Apr 29th 2017, 12:33 |
cleptric |
@bravo-kernel https://github.com/cakephp/cakephp/issues/10432 |
# |
Apr 29th 2017, 12:32 |
chris-andre |
@metoyoko in setTable() you pass the actual name of your table in db. className() shall contain the name of your table class. |
# |
Apr 29th 2017, 12:31 |
slackebot1 |
Action: bravo-kernel confused |
# |
Apr 29th 2017, 12:31 |
bravo-kernel |
Is it me or is there nothing out there concerning binary(16) uuid (yet)? |
# |
Apr 29th 2017, 11:58 |
slackebot1 |
crud for table param. [cake bake all param] No effect. Same results. Now, since param_id and id follow CakePHP conventions, I tried this: $this->belongsTo('param'); ERROR: THE USER COULD NOT BE SAVED $this->belongsTo('Params'); ERROR: TABLE PARAMS DOES NOT EXIST $this-belongsTo('anythingelse'); DOES NOT SAVE param.ADDRESS1 |
# |
Apr 29th 2017, 11:58 |
loginews |
@admad Regarding : https://gist.github.com/loginews/78dbc099fe1689332c299002d361f472> $this->belongsTo('param')->setForeignKey('id')->setProperty('param_id'); DOES NOT SAVE param.ADDRESS1 $this->belongsTo('anythingelse')->setForeignKey('id')->setProperty('param_id'); DOES NOT SAVE param.ADDRESS1 $this->belongsTo('Params')->setForeignKey('id')->setProperty('param_id'); DOES NOT SAVE param.ADDRESS1 I had not yet baked a crud for table param |
# |
Apr 29th 2017, 11:42 |
chris-andre |
Good :slightly_smiling_face: |
# |
Apr 29th 2017, 11:41 |
saeideng |
worked well |
# |
Apr 29th 2017, 11:40 |
chris-andre |
Try allowEmpty |
# |
Apr 29th 2017, 11:40 |
saeideng |
cake 3.4.x |
# |
Apr 29th 2017, 11:39 |
saeideng |
receive "This field cannot be left empty" error |
# |
Apr 29th 2017, 11:39 |
saeideng |
i can send image to server but |
# |
Apr 29th 2017, 11:38 |
saeideng |
//$validator //->requirePresence('image', 'create') //->notEmpty('image') // ; |
# |
Apr 29th 2017, 11:37 |
saeideng |
i want to disable validator empty for image input |
# |
Apr 29th 2017, 11:20 |
metoyoko |
Hi @admad is setTable and className are the same? thanks |
# |
Apr 29th 2017, 11:18 |
metoyoko |
@dereuromark thanks |
# |
Apr 29th 2017, 11:16 |
loginews |
sorry... I can't help being a grumpy old man! brb |
# |
Apr 29th 2017, 11:14 |
admad |
If the 2 are not associated in any way then there's no business modifying those values together. Unless there's some association between the 2 models ORM can't save them in a single save() call. |
# |
Apr 29th 2017, 11:13 |
loginews |
@admad in fact the 2 tables are not linked in any way! I created a link to please Cake !!! :slightly_smiling_face: |
# |
Apr 29th 2017, 11:11 |
loginews |
I will go and correct that and come back asap. |
# |
Apr 29th 2017, 11:11 |
loginews |
no... let me explain. Param contains standard parameters, (a single record) and I want (for instance) to allow the user to change his own parameters, and also some system parameters at the same time. I don't want to create two input screens for that, one for the user's profile parameters, and another for the overall system parameters. Users don't understand systems. |
# |
Apr 29th 2017, 11:08 |
admad |
Are you sure you need Users belongsTo Params? I would have guess a user has multiple params hence Users hasMany Params |
# |
Apr 29th 2017, 11:08 |
loginews |
ok... let me try to correct that. |