# |
Dec 9th 2016, 16:29 |
din |
Still struggling with the onlyIds option. Code here: http://pastebin.com/VycMMiah Works the first time when adding, but even just re-saving removes the shipment id from the package and creates a new, empty package for some reason |
# |
Dec 9th 2016, 16:26 |
philipgrey |
something like that? |
# |
Dec 9th 2016, 16:26 |
philipgrey |
```->matching(‘Categories', function ($q) { return $q->where([‘categories.id IN' => [1,2,3]]); });``` |
# |
Dec 9th 2016, 16:25 |
philipgrey |
i believe just object, it needs to be chained |
# |
Dec 9th 2016, 16:24 |
Leonardo_0112 |
philipgrey, Can I use matching with array syntax? Or just object (->matching(...)) ?? |
# |
Dec 9th 2016, 16:24 |
philipgrey |
which will filter down your products by the categories |
# |
Dec 9th 2016, 16:23 |
philipgrey |
i believe you watching to use the matching functionality |
# |
Dec 9th 2016, 16:22 |
Leonardo_0112 |
philipgrey, Yes, all products tht belongs to categories 1, 2 and 3 |
# |
Dec 9th 2016, 16:20 |
philipgrey |
do you want products within those categories? |
# |
Dec 9th 2016, 16:18 |
Leonardo_0112 |
Can someone help me? What am I missing in many-to-many find? http://pastebin.com/0pFMM3r3 |
# |
Dec 9th 2016, 16:16 |
philipgrey |
Them brackets… i tell ya |
# |
Dec 9th 2016, 16:16 |
philipgrey |
```$contain['CustomerRecords.Leads'] = function ($q) { return $q->matching('Users', function ($r) { return $r->where(['Users.id' => $this->AuthUser->id()]); }); };``` |
# |
Dec 9th 2016, 16:15 |
philipgrey |
If it’s of interest to anyone, I solved my query above |
# |
Dec 9th 2016, 16:07 |
Neon1024 |
I need to do a distinct, but I have lots of contains |
# |
Dec 9th 2016, 16:07 |
Neon1024 |
Does Cake 2 have autofields? |
# |
Dec 9th 2016, 15:59 |
philipgrey |
id love to hear a better way though |
# |
Dec 9th 2016, 15:59 |
philipgrey |
thats what i do @spriz |
# |
Dec 9th 2016, 15:58 |
spriz |
When having a ton of resource routes, it seems crazy to put the custom option there every time for the dashed route - or is it just me? :thinking_face: |
# |
Dec 9th 2016, 15:49 |
philipgrey |
intuitively it feels like it shouldn’t be a problem |
# |
Dec 9th 2016, 15:49 |
philipgrey |
is it possible to use matching within a contain conditional? |
# |
Dec 9th 2016, 15:49 |
philipgrey |
```$contain['CustomerRecords.Leads'] = function ($q) { return $q->matching(['Users'], function ($r) { $r->where(['Users.id' => $this->AuthUser->id()]); }); };``` |
# |
Dec 9th 2016, 15:38 |
din |
I don't know if I've misinterpreted what the onlyIds option is supposed to do, or whether I'm doing something else wrong |
# |
Dec 9th 2016, 15:36 |
din |
ModelA hasMany ModelB. When an A entity has no B's associated yet, the save works as expected. But when there are existing B entities, a save using onlyIds wipes the existing ones and create a new, empty, B entity and associates only that with the A entity. |
# |
Dec 9th 2016, 15:31 |
din |
Looking for some assistance with the "onlyIds" option and hasMany relationships |
# |
Dec 9th 2016, 15:23 |
Neon1024 |
s/cyptic/cryptic |
# |
Dec 9th 2016, 15:23 |
Neon1024 |
Thanks for the cyptic input there ADmad, finally figured out what you meant :) |
# |
Dec 9th 2016, 15:22 |
Neon1024 |
Yep, agreed |
# |
Dec 9th 2016, 15:20 |
hmic |
well. he will come back when savant is around, and it's gonna be a hard debugging session looking at the GH issue... so props to savant for taking it! |
# |
Dec 9th 2016, 15:19 |
hmic |
me too... |
# |
Dec 9th 2016, 15:19 |
Neon1024 |
¯\_(ツ)_/¯ |
# |
Dec 9th 2016, 15:18 |
Neon1024 |
Oh, that chap left, was about to offer some thougts |
# |
Dec 9th 2016, 15:17 |
luv2quit |
Neon1024: no, thank you! |
# |
Dec 9th 2016, 15:17 |
Neon1024 |
Haha, thanks luv2quit |
# |
Dec 9th 2016, 15:16 |
luv2quit |
Neon1024: thank you! you are great! |
# |
Dec 9th 2016, 15:15 |
Neon1024 |
cakephp701: savant is asleep now, he’s usually on EST timezone |
# |
Dec 9th 2016, 15:13 |
cakephp701 |
i need help in fixing this |
# |
Dec 9th 2016, 15:13 |
cakephp701 |
https://github.com/josegonzalez/cakephp-upload/issues/422 |
# |
Dec 9th 2016, 15:13 |
Neon1024 |
and not id |
# |
Dec 9th 2016, 15:13 |
Neon1024 |
Because it’s iD |
# |
Dec 9th 2016, 15:13 |
luv2quit |
In my database i have one table. It has in id column called id. When i do findById the id is split up into i_d in the sql query. So i get an error. Any ideas why id is split into i_d? |
# |
Dec 9th 2016, 15:10 |
Neon1024 |
Although the thought does occur that the empty params might be because I’m using a GET form instead of POST |