# |
Jan 14th 2020, 18:29 |
ndm |
@andre.karner `$user` probably isn't what you think it is, check `debug(get_class($user))` |
# |
Jan 14th 2020, 18:27 |
ricksaccous |
okay it's reading from my yaml just not working, hmmmm |
# |
Jan 14th 2020, 18:27 |
andre.karner |
and that: https://github.com/cakephp/cakephp/issues/14172 |
# |
Jan 14th 2020, 18:26 |
andre.karner |
anyone encountered similar issue like that? https://github.com/cakephp/cakephp/issues/14171 |
# |
Jan 14th 2020, 18:25 |
andre.karner |
hey guys - since my issue on github got closed I am trying to find help here, although i think that it is a bug .. |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
do i have to do rectory rector.yaml? like feed the file to the command |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
the docs don't say you have to do anything special |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
how can i make sure rector is reading from rector.yaml? |
# |
Jan 14th 2020, 17:01 |
this.impetus |
Yeah, I just got there; `$query->execute()->fetchAll()` gets it done, tyvm. |
# |
Jan 14th 2020, 17:01 |
neon1024 |
You’re right, that execute() returns the compiled statement :) |
# |
Jan 14th 2020, 17:01 |
neon1024 |
Yes, my apologies @this.impetus it should be `all()` |
# |
Jan 14th 2020, 16:59 |
neon1024 |
I’m sure they used to be in the repo, but I can’t find them right now |
# |
Jan 14th 2020, 16:58 |
neon1024 |
But I believe Rector has change sets for like 3.4, 5 or 6 upwards |
# |
Jan 14th 2020, 16:58 |
neon1024 |
The 4.x upgrade tool uses Rector https://github.com/cakephp/upgrade/tree/4.x |
# |
Jan 14th 2020, 16:57 |
ricksaccous |
@neon1024 thanks man you are changing my life right now |
# |
Jan 14th 2020, 16:57 |
neon1024 |
@ricksaccous Yeah the versions are in Rector, it already knows about CakePHP |
# |
Jan 14th 2020, 16:57 |
neon1024 |
Perhaps you need `all()` I forget |
# |
Jan 14th 2020, 16:56 |
javier.villanueva |
:S |
# |
Jan 14th 2020, 16:56 |
this.impetus |
`Call to undefined method Cake\Database\Statement\CallbackStatement::toArray()` |
# |
Jan 14th 2020, 16:56 |
this.impetus |
@neon1024 No, actually, you can't; that throws an undefined method error |
# |
Jan 14th 2020, 16:56 |
ricksaccous |
oh i can't specify version? |
# |
Jan 14th 2020, 16:56 |
neon1024 |
Rector is a stand alone tool |
# |
Jan 14th 2020, 16:56 |
neon1024 |
@ricksaccous Only for 4.x I believe |
# |
Jan 14th 2020, 16:56 |
ricksaccous |
or is rector the only plugin i need |
# |
Jan 14th 2020, 16:56 |
ricksaccous |
is there a plugin on top of rector |
# |
Jan 14th 2020, 16:55 |
neon1024 |
You can cast that to array `$query->execute()->toArray()` |
# |
Jan 14th 2020, 16:55 |
this.impetus |
@neon1024 Yeah, I just found this, I didn't realize it was an inherited method; still, `debug($query->execute()` doesn't actually contain the retrieved rows; it tells me that there *were* retrieved rows, lololol, but it doesn't contain them. Like, do I literally have to iterate over the object to see any data??? |
# |
Jan 14th 2020, 16:54 |
ricksaccous |
i'll have to look into rector |
# |
Jan 14th 2020, 16:53 |
neon1024 |
@ricksaccous Rector might have a changeset for that |
# |
Jan 14th 2020, 16:53 |
ricksaccous |
int he upgrade from 3.7 to 3.8 |
# |
Jan 14th 2020, 16:53 |
ricksaccous |
is there an automatic way to switch the params for allowEmpty... methods |
# |
Jan 14th 2020, 16:53 |
neon1024 |
@this.impetus To execute the query you need to call `$query->all()` or `$query->execute()` or `$query->first()` or something similar to cause a ResultSet or Entity |
# |
Jan 14th 2020, 16:51 |
this.impetus |
@javier.villanueva naw the keys are right, that functionality just isn't part of getData() I am pretttty sure. I mean one can do this with basic PHP's array manipulation functions, but back in the day Cake always had it's own ways of doing these things, I assume they still exist and I just need to relearn |
# |
Jan 14th 2020, 16:49 |
this.impetus |
... htf does one just see the *and^^%$ result of a query object. `debug($query)` just prints out details of the MySQL request thats *going* to happen; `debug($query->toArray())` tells me that I'm trying to perform that on an array; cake tells me to see the results I should execute the query but there is no such method... like, I just want to see the results of the query. |
# |
Jan 14th 2020, 16:49 |
javier.villanueva |
debug your request to find your key |
# |
Jan 14th 2020, 16:48 |
javier.villanueva |
getData('authors._ids') ? |
# |
Jan 14th 2020, 16:36 |
this.impetus |
If I want to pull specific fields from a nested structure in a request object, does Cake have a utility for doing this? ie. something to this effect `$this->request->getData('Authors.ids')` (this doesn't work; getData() just takes a string that has to match a key). |
# |
Jan 14th 2020, 15:42 |
shifat.it |
ok |
# |
Jan 14th 2020, 15:41 |
ricksaccous |
@shifat.it you want to pay attention to URL Rewriting |
# |
Jan 14th 2020, 15:41 |
ricksaccous |
https://book.cakephp.org/3/en/installation.html |
# |
Jan 14th 2020, 15:40 |
ricksaccous |
please read through the suggested set up |