# |
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 |
# |
Jan 14th 2020, 15:39 |
shifat.it |
why ?? |
# |
Jan 14th 2020, 15:39 |
shifat.it |
it works perfectly |
# |
Jan 14th 2020, 15:39 |
shifat.it |
but if i do "cake server" |
# |
Jan 14th 2020, 15:39 |
shifat.it |
it doesn't load css |
# |
Jan 14th 2020, 15:38 |
shifat.it |
In my local machine if i start apache, mysql and then try url "localhost/project_name" |
# |
Jan 14th 2020, 15:38 |
shifat.it |
Tibor. |
# |
Jan 14th 2020, 15:37 |
shifat.it |
ok |
# |
Jan 14th 2020, 15:35 |
tibor.hajos |
@shifat.it Do you mean that you want to deploy your site on a server? ```bin/cake server``` is meant for development purposes only. If you'd like to deploy your project to yoursitehere.com there's an awesome guide here: https://book.cakephp.org/3/en/deployment.html |
# |
Jan 14th 2020, 15:33 |
shifat.it |
?? |
# |
Jan 14th 2020, 15:28 |
shifat.it |
Please help |
# |
Jan 14th 2020, 15:28 |
shifat.it |
May be it sounds so silly. but i dont have idea. |
# |
Jan 14th 2020, 15:28 |
shifat.it |
how can i run this on hosting site? |
# |
Jan 14th 2020, 15:27 |
shifat.it |
it runs at "localhost:8765" |
# |
Jan 14th 2020, 15:27 |
shifat.it |
I have a cake php project which i run using "/bin cake server" |
# |
Jan 14th 2020, 15:27 |
shifat.it |
I need your help |
# |
Jan 14th 2020, 15:26 |
shifat.it |
Hello |
# |
Jan 14th 2020, 14:52 |
this.impetus |
All kidding aside, sometimes one wants to learn the proper way to do a thing, and other times one wants permission to just get it done. :P |
# |
Jan 14th 2020, 14:51 |
neon1024 |
It’s only a thought ;) |
# |
Jan 14th 2020, 14:48 |
this.impetus |
@neon1024 Noted. I will attempt that, and then when I discover how little I understand what you're saying, will feel fine about mashing together some inelegant solution, confident that there wasn't a dead-easy option I'd missed. God I love this slack. |
# |
Jan 14th 2020, 14:47 |
neon1024 |
My first thought approach would be to use an array id’s for the records, and use some array_intersect callback or collections::filter method to create the two arrays you want, a keep and a delete and then action those in the ORM as required |
# |
Jan 14th 2020, 14:42 |
slackebot |
but intuitively... I'm assuming Cake thinks about this differently. |
# |
Jan 14th 2020, 14:42 |
this.impetus |
Hey guys, can anyone point me to where I might read about to remove established HABTM relationships when editing a record? Started here: https://book.cakephp.org/3/en/orm/saving-data.html#unlink-many-to-many-records But in context, the request object contains an array of the associations which should *remain* after the edit, rather than those being removed. I can easily enough manually do this in the controller with a little inference, |
# |
Jan 14th 2020, 14:34 |
ndm |
Thing is the clause isn't stored as an array, but as a query expression object, so there's really no other way :S |
# |
Jan 14th 2020, 14:26 |
neon1024 |
Iterating is clearer though :thumbsup: |
# |
Jan 14th 2020, 14:26 |
neon1024 |
..and `where()` with the second param `true` |
# |
Jan 14th 2020, 14:25 |
neon1024 |
I was thing `clause()` |