# |
Dec 17th 2019, 18:17 |
ashesh.social |
Hey all |
# |
Dec 17th 2019, 17:58 |
jotpe |
Ah, it's the same: https://book.cakephp.org/3/en/orm/retrieving-data-and-resultsets.html#eager-loading-associations-via-contain |
# |
Dec 17th 2019, 17:57 |
jotpe |
Seems to work both |
# |
Dec 17th 2019, 17:56 |
dereuromark |
pretty sure the dot syntax is a bit more convenient to type |
# |
Dec 17th 2019, 17:56 |
dereuromark |
did u try it? |
# |
Dec 17th 2019, 17:56 |
jotpe |
is there a difference between `->contain([Model1.Model2])` and `->contain(Model1 => [Model2])`? |
# |
Dec 17th 2019, 17:00 |
dereuromark |
I usually add the session data into the real session, less mocking involved |
# |
Dec 17th 2019, 16:58 |
lucas.iturbide |
how can I set an Auth session for testing a Helper which uses the session from the request in the view: ``` $user = $this->getView()->getRequest()->getSession()->read("Auth.User");``` and in my test I want to verify that the user is the one I set by $this->session( [ “Auth” => [ “User” => $user->toArray() ] ] ); |
# |
Dec 17th 2019, 16:28 |
martin |
hmm intresting, cakephp 1.3 works on mysql 8 |
# |
Dec 17th 2019, 16:22 |
neon1024 |
Ah, that moment when your Component name is the same as your Table class name :face_palm: |
# |
Dec 17th 2019, 16:14 |
neon1024 |
Perhaps, I’ll see if `$this->Form->secure()` works for me first :thinking_face: |
# |
Dec 17th 2019, 16:11 |
neon1024 |
Or shall I just unlock all my ajax actions, as that seems to be what Past Dave (tm) has done |
# |
Dec 17th 2019, 16:09 |
neon1024 |
Is there a neat way to generate `_Token` for Ajax? |
# |
Dec 17th 2019, 15:58 |
gianmarxgagliardi |
I did a similar exercise with DogsCats with the same data structure and also gave me the names of the fields |
# |
Dec 17th 2019, 15:51 |
jotpe |
?!? |
# |
Dec 17th 2019, 15:51 |
jotpe |
https://book.cakephp.org/3/en/orm/retrieving-data-and-resultsets.html#finding-key-value-pairs |
# |
Dec 17th 2019, 15:46 |
neon1024 |
:exclamation: |
# |
Dec 17th 2019, 15:45 |
gianmarxgagliardi |
? |
# |
Dec 17th 2019, 15:40 |
neon1024 |
As it doesn’t seem that I can, but worth a check. Different View template scope right? |
# |
Dec 17th 2019, 15:40 |
neon1024 |
Can I append to the script block from inside a Cell template? |
# |
Dec 17th 2019, 15:38 |
gianmarxgagliardi |
:-(ù |
# |
Dec 17th 2019, 15:37 |
neon1024 |
Haha, I bet it isn’t ;) |
# |
Dec 17th 2019, 15:36 |
dereuromark |
is that find(list)? set up a displayName as documented |
# |
Dec 17th 2019, 15:34 |
gianmarxgagliardi |
how could I take the name from the trainers table or clubs since I have the id? |
# |
Dec 17th 2019, 15:33 |
neon1024 |
Isn’t it Sqlite by default and MySQL by configuration? |
# |
Dec 17th 2019, 15:33 |
dereuromark |
i dont think so |
# |
Dec 17th 2019, 15:23 |
kaliel |
hi everyone, is that the desirable behavior for debugkit in cake 4 to store panels and requests in sql instead of sqlite ? |
# |
Dec 17th 2019, 15:11 |
gianmarxgagliardi |
I have three tables with this structure: https://pastebin.com/e2PwW5bs when I go to work on the seasons_trainers table by adding an ennuple using the special "add" function developed in SeasonsTrainersController it shows me only ID of "trainer" or "club", but I would like to show the name |
# |
Dec 17th 2019, 15:06 |
luke |
under the contain |
# |
Dec 17th 2019, 15:06 |
luke |
should be able to put it in the select statement |
# |
Dec 17th 2019, 15:06 |
jotpe |
I'll try with distinct now |
# |
Dec 17th 2019, 15:06 |
luke |
no problem |
# |
Dec 17th 2019, 15:06 |
jotpe |
Nevertheless thanks :) |
# |
Dec 17th 2019, 15:05 |
jotpe |
Yeah, that's what I'm trying now ;) |
# |
Dec 17th 2019, 15:05 |
luke |
I sometimes find with more complex queries, writing it in sql first, and getting it to work, then pushing it into query builder |
# |
Dec 17th 2019, 15:03 |
luke |
or change to an outer join |
# |
Dec 17th 2019, 15:02 |
luke |
try select distinct maybe? |
# |
Dec 17th 2019, 15:02 |
jotpe |
Yes, and if I remove the group by I have duplicate membersips. I want them just once. |
# |
Dec 17th 2019, 15:01 |
gianmarxgagliardi |
sorry someone could help me with my problem |
# |
Dec 17th 2019, 15:00 |
luke |
if there are more than one, the response object will have all associated records attached which match the conditions |
# |
Dec 17th 2019, 15:00 |
luke |
I dont think group by is what you are looking for then |