# |
Jul 5th 2017, 21:55 |
jeremyharris |
if you use debug kit, you can inspect what variables the view is getting |
# |
Jul 5th 2017, 21:55 |
jeremyharris |
yep! that’s usually how it is done |
# |
Jul 5th 2017, 21:54 |
origamiwork |
Should I be able to pass a query object to a view? I was passing the results of the magic findBy function to a view and iterating through them there, but it wasn't able to find any of the variables. |
# |
Jul 5th 2017, 21:53 |
origamiwork |
Awesome, thanks. |
# |
Jul 5th 2017, 21:50 |
jeremyharris |
(for future ref) |
# |
Jul 5th 2017, 21:50 |
jeremyharris |
if you want to inspect the results without iterating through them, you can use ->toArray() |
# |
Jul 5th 2017, 21:49 |
origamiwork |
@slackebot Thanks for the info, I was actually using that link to write my code. I think what you said about iterating is working. When I loop through the results using foreach, it seems to have the correct data. |
# |
Jul 5th 2017, 21:38 |
jeremyharris |
more info: https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#dynamic-finders |
# |
Jul 5th 2017, 21:37 |
jeremyharris |
to execute, iterate through the results like you would a regular find() query, or use first(), all(), etc |
# |
Jul 5th 2017, 21:37 |
jeremyharris |
perhaps what you’re seeing is the debug output, which shows information about the query but doesn’t actually execute it |
# |
Jul 5th 2017, 21:36 |
jeremyharris |
origamiwork it will return a query object |
# |
Jul 5th 2017, 21:35 |
origamiwork |
Hello everybody, should a magic findBy function return the SQL it's trying to execute? I have a field in a table called urlname, and when I run the function findByUrlname($url_name), it returns "SELECT Pg.id AS `Pg__id`, Pg.urlname AS `Pg__urlname`, ... WHERE Pg.urlname = :c0" |
# |
Jul 5th 2017, 20:57 |
gutts |
wouldn't I have to use call_user_func if I did that? or is there some tricky way of doing it |
# |
Jul 5th 2017, 20:56 |
gutts |
since it accepts a closure |
# |
Jul 5th 2017, 20:56 |
gutts |
hm, i need the same function to pass to notEmpty. is there an easy way to reference it if I define it in my model table? |
# |
Jul 5th 2017, 20:00 |
jarard01 |
ohh i got it - very nice |
# |
Jul 5th 2017, 19:58 |
jarard01 |
is there a cake way of converting a date to datetime, ie 1 Jul 2017 to '2017-07-01 00:00:00' |
# |
Jul 5th 2017, 19:57 |
mcf |
According to this PR comment from 3 weeks ago php72-intl is supposed to be in there already: https://github.com/Homebrew/homebrew-php/pull/4211#issuecomment-307159234 |
# |
Jul 5th 2017, 19:56 |
cleptric |
No, it was ??= ? |
# |
Jul 5th 2017, 19:54 |
cleptric |
I’ll try it again later. ?== al the things |
# |
Jul 5th 2017, 19:51 |
savant |
probably some asshat out there if there are RCs has already PRd it |
# |
Jul 5th 2017, 19:49 |
cleptric |
To lazy to compile it by myself |
# |
Jul 5th 2017, 19:49 |
cleptric |
@mfc or better @savant Does hombrew added php72-intl That was my only show stopper a few days ago |
# |
Jul 5th 2017, 19:48 |
jeremyharris |
:P |
# |
Jul 5th 2017, 19:48 |
jeremyharris |
NOT IT |
# |
Jul 5th 2017, 19:48 |
admad |
wonderful phpunit issue again |
# |
Jul 5th 2017, 19:47 |
WyriHaximus |
There you go: https://travis-ci.org/cakephp/cakephp/jobs/250489011#L654-L656 |
# |
Jul 5th 2017, 19:32 |
WyriHaximus |
Was about to do the same :) |
# |
Jul 5th 2017, 19:29 |
admad |
I took the liberty of adding a commit on top :slightly_smiling_face: |
# |
Jul 5th 2017, 19:29 |
WyriHaximus |
Looking at it |
# |
Jul 5th 2017, 19:24 |
admad |
*travis config.. |
# |
Jul 5th 2017, 19:24 |
admad |
WyriHaximus: the nightly builds aren't running. The travis needs to be tweaked further https://travis-ci.org/cakephp/cakephp/jobs/250473818#L596 |
# |
Jul 5th 2017, 19:22 |
mcf |
@admad no problem. I'm trying to fix it as well, but I'm running into some interface weirdness... |
# |
Jul 5th 2017, 19:14 |
admad |
@mcf Thanks for the submitting the issue |
# |
Jul 5th 2017, 19:04 |
mcf |
@savant https://github.com/cakephp/cakephp/issues/10862 |
# |
Jul 5th 2017, 18:56 |
savant |
@mcf let me know when you’ve filed that issue |
# |
Jul 5th 2017, 18:56 |
savant |
cool |
# |
Jul 5th 2017, 18:52 |
WyriHaximus |
s/on/enabled |
# |
Jul 5th 2017, 18:52 |
WyriHaximus |
Actually both already have fast finish on :) |
# |
Jul 5th 2017, 18:52 |
WyriHaximus |
on chronos I assume? Sure in the same PR? |
# |
Jul 5th 2017, 18:51 |
jarard01 |
grr of course |