# |
Mar 27th 2019, 20:20 |
ricksaccous |
if you contain it and it gets hydrated |
# |
Mar 27th 2019, 20:20 |
ricksaccous |
i don't think he cares to delete one after the other, he just wants to delete it from the other model, lol |
# |
Mar 27th 2019, 20:20 |
cnizzardini |
But I assume it would work with hasOne |
# |
Mar 27th 2019, 20:19 |
cnizzardini |
I know the example shown is for hasMany |
# |
Mar 27th 2019, 20:19 |
cnizzardini |
Does cascading deletes not working? |
# |
Mar 27th 2019, 20:18 |
andy-ttg |
i could get around it by deleting them straight up, but just thought I would ask if there was a more elegant solution |
# |
Mar 27th 2019, 20:17 |
andy-ttg |
right, it's kinda of weird case |
# |
Mar 27th 2019, 20:16 |
ricksaccous |
but i think you just want to clear the associated record |
# |
Mar 27th 2019, 20:16 |
ricksaccous |
hasOne? kind of weird, i thought you meant delete one after you delete the other |
# |
Mar 27th 2019, 20:16 |
ricksaccous |
oh wait |
# |
Mar 27th 2019, 20:15 |
ricksaccous |
@andy-ttg foreign keys |
# |
Mar 27th 2019, 20:12 |
cnizzardini |
https://book.cakephp.org/3.0/en/orm/deleting-data.html#cascading-deletes |
# |
Mar 27th 2019, 20:12 |
cnizzardini |
Isn't there a cascade option on the Table class or something? |
# |
Mar 27th 2019, 20:11 |
cnizzardini |
Ive never tried that before, i think ive always just manually issued the delete in that case |
# |
Mar 27th 2019, 20:11 |
cnizzardini |
Ahh i see |
# |
Mar 27th 2019, 20:10 |
andy-ttg |
oh, I'm sorry, I don't mean remove the association, I mean remove the associated row from the database |
# |
Mar 27th 2019, 20:09 |
cnizzardini |
You can edit associations using TableRegistry |
# |
Mar 27th 2019, 20:06 |
andy-ttg |
Is there a good way to remove a hasOne association through the first object? Like User hasOne Profile, and I want to remove the Profile by saving like `$this->User->save($data)`. I tried setting `$data->profile = null`, but that doesn't work. I wish there was a saveStrategy on hasOne associations like hasMany does. |
# |
Mar 27th 2019, 20:02 |
cnizzardini |
where 1st arg is the submitted password and the 2nd argument is what is in the database |
# |
Mar 27th 2019, 20:01 |
cnizzardini |
$hasher->check($this->request->getData('new_password'), $pwd->passphrase) |
# |
Mar 27th 2019, 20:01 |
cnizzardini |
$hasher = new DefaultPasswordHasher(); |
# |
Mar 27th 2019, 20:01 |
cnizzardini |
If you are doing things the cake way I believe the correct way to do so is: |
# |
Mar 27th 2019, 19:59 |
cnizzardini |
You are talking about this: https://www.php.net/manual/en/function.password-verify.php ? |
# |
Mar 27th 2019, 19:25 |
joopm |
is anyone can explain why password_verify function return false(i checked the hashed value so i expect it must be true)? |
# |
Mar 27th 2019, 18:57 |
Nate_ |
I am looking for documentation on installing cake php on the Google Cloud? |
# |
Mar 27th 2019, 17:30 |
cnizzardini |
#landmineseverywhere |
# |
Mar 27th 2019, 17:22 |
dereuromark |
use git diff |
# |
Mar 27th 2019, 17:21 |
cnizzardini |
Anyone know what happened to configurations in config/app_form.php between 3.5 and 3.7? |
# |
Mar 27th 2019, 16:06 |
alexdd55 |
+ java :face_with_rolling_eyes: |
# |
Mar 27th 2019, 16:05 |
alexdd55 |
elasticsearch is too much for what i need, also i have to install tons of stuff for that |
# |
Mar 27th 2019, 16:04 |
alexdd55 |
:face_palm: |
# |
Mar 27th 2019, 16:04 |
alexdd55 |
why so ever.. solution is easy |
# |
Mar 27th 2019, 16:03 |
alexdd55 |
`implode('|', $object->toArray())` |
# |
Mar 27th 2019, 16:03 |
cnizzardini |
What are you trying to accomplish |
# |
Mar 27th 2019, 16:03 |
cnizzardini |
Why do you need this? |
# |
Mar 27th 2019, 16:03 |
alexdd55 |
oh… i got it |
# |
Mar 27th 2019, 16:03 |
cnizzardini |
Though it depends on the use cases |
# |
Mar 27th 2019, 16:02 |
cnizzardini |
^ |
# |
Mar 27th 2019, 16:02 |
neon1024 |
Full text search I mean, although I’d probably look at a specific solution for it like Elasticsearch |
# |
Mar 27th 2019, 16:02 |
neon1024 |
Although there is probably a plugin for this kind of thing |
# |
Mar 27th 2019, 16:02 |
neon1024 |
Or just as @cnizzardini said, add a mutation method or implement toString |