Log message #4180957

# At Username Text
# Mar 26th 2019, 21:27 admad gn
# Mar 26th 2019, 21:27 admad xdebug is the de facto php debugger
# Mar 26th 2019, 21:27 admad google just for php debugging, not cakephp specific
# Mar 26th 2019, 21:26 admad you wont finding anything in cookbook regarding it since using a php debugger is a general php thing not specific to cakephp
# Mar 26th 2019, 21:24 JayDeLux_ ... unless you have a link handy that would save my night (regards from belgium)
# Mar 26th 2019, 21:24 JayDeLux_ Txs, I guess I will have to dig deeper in Google with different keywords to figure out how to set this up; I spent the last couple of day son the Cookbook though, didn't come across something relevant (for my defence I come from Java world, struggling a bit learning cake and PHP at the same time
# Mar 26th 2019, 21:22 admad JayDelux_: cakephp like any php code can be debugged using a debugger :slightly_smiling_face:
# Mar 26th 2019, 21:19 JayDeLux_ Hello. Looking into Cackephp for a small prject. 1 point I'd like to clarify: Is it not possible to plug my IDE (Eclipse) debuger to step through my code to debug? Is the only way to debug to show values using debug($value)? Thank you in advance.
# Mar 26th 2019, 20:10 itmpls yep manual worked, i wonder if there's a trigger to have cake do that itself..
# Mar 26th 2019, 20:06 ricksaccous yeah maybe give that a go, usually that makes columns accessible
# Mar 26th 2019, 20:05 itmpls could probably do a manual join() i guess too
# Mar 26th 2019, 20:04 itmpls seems like i may have to
# Mar 26th 2019, 20:04 itmpls yeah.. mm
# Mar 26th 2019, 20:04 itmpls i'm trying to avoid a collection
# Mar 26th 2019, 20:04 ricksaccous if it's a hasmany not sure if you could do that though, the join thing
# Mar 26th 2019, 20:03 ricksaccous you can do it with collections or you'd have to do a join in order to make the column accessible
# Mar 26th 2019, 20:02 itmpls how can I apply a sum() select to a 2 level association that gets pulled in through a separate query through cake? 'jobs' hasMany documents and documents hasMany line_items.. $jobsQuery->select(['price_sum' => $jobsQuery->func()->sum('LineItems.price')])->contain(['Documents.LineItems']) -> column doesn't exist. tried a sum() within the contain as well..
# Mar 26th 2019, 18:21 ricksaccous works like a charmmm
# Mar 26th 2019, 18:17 ricksaccous thank you
# Mar 26th 2019, 18:17 ricksaccous @dereuromark sorry, was the cache
# Mar 26th 2019, 18:16 ricksaccous let me see that could be it
# Mar 26th 2019, 18:16 dereuromark cache issue?
# Mar 26th 2019, 18:16 ricksaccous weird, because i just ran the migrations fresh
# Mar 26th 2019, 18:16 dereuromark sounds like you either didnt run the migrations correctly, or have some other data integrity issue
# Mar 26th 2019, 18:15 ricksaccous i mean bin/cake queue but you get what i mean
# Mar 26th 2019, 18:15 ricksaccous @dereuromark i'm getting trouble after trying bin/queue runworker i get General error: 1364 Field 'workerkey' doesn't have a default value in
# Mar 26th 2019, 17:20 devito the calculated colum is created, however when i try to add where conditions to the query targeting the calculated column i still get the missing column error. im guess the where func is scanning the schema columns and not the items used in the select.
# Mar 26th 2019, 16:13 devito thanks. let me tinker with this
# Mar 26th 2019, 16:13 devito mm i see
# Mar 26th 2019, 16:13 neon1024 You can also use `->enableAutoFields(true)` I think to get all columns from all tables
# Mar 26th 2019, 16:12 neon1024 As per the comment given in the example, it’s passing a Table instance into the select() to get all the available fields
# Mar 26th 2019, 16:12 devito or is that just to get the rest of the fields as well as the calculated field
# Mar 26th 2019, 16:12 devito do i need to pass in the table obj to the select like it is doing on that last select?
# Mar 26th 2019, 16:11 neon1024 Although you might need to use HAVING I think :thinking_face:
# Mar 26th 2019, 16:11 neon1024 Yep
# Mar 26th 2019, 16:11 devito rightso with this i should now be able to access slug in a where condition righ
# Mar 26th 2019, 16:10 neon1024 You don’t need to pass in a query object
# Mar 26th 2019, 16:10 devito right
# Mar 26th 2019, 16:10 neon1024 Yeah, it’s just sql language agnostic concat
# Mar 26th 2019, 16:10 devito ``` // Only all fields from the articles table including // a calculated slug field. $query = $articlesTable->find(); $query ->select(['slug' => $query->func()->concat(['title' => 'identifier', '-', 'id' => 'identifier'])]) ->select($articlesTable); // Select all fields from articles ```
# Mar 26th 2019, 16:08 devito https://book.cakephp.org/3.0/en/orm/query-builder.html#selecting-specific-fields