Log message #4099518

# At Username Text
# Nov 29th 2017, 22:02 saeideng `$result = $now->i18nFormat(\IntlDateFormatter::FULL, null, 'en-IR@calendar=persian');`
# Nov 29th 2017, 22:00 saeideng like calendar in cakephp/time
# Nov 29th 2017, 22:00 saeideng I need timezone + calendar in chronos
# Nov 29th 2017, 21:59 saeideng no
# Nov 29th 2017, 21:59 saeideng gui?
# Nov 29th 2017, 21:58 dereuromark I use https://github.com/dereuromark/cakephp-calendar for some basic gui
# Nov 29th 2017, 21:58 dereuromark you could look into the open carbon issues, they discussed this, and there might be already a few libs around this in php that could serve as ideas
# Nov 29th 2017, 21:57 saeideng how can we add calendar into chronos ?
# Nov 29th 2017, 21:50 inoas you can use formatResults as I said to tinker with the resultset and make it a single item
# Nov 29th 2017, 21:09 saeideng first show your native sql
# Nov 29th 2017, 21:08 saeideng if you need first first in joined table you can not IMO
# Nov 29th 2017, 21:07 saeideng first on resultset
# Nov 29th 2017, 21:07 joopm saeideng my query is more than complicated to not to konw how to use ->first() in simple query
# Nov 29th 2017, 21:07 saeideng first on query
# Nov 29th 2017, 21:06 saeideng because we have 2 first()
# Nov 29th 2017, 21:06 inoas well that first() is probably a collection method or so
# Nov 29th 2017, 21:06 inoas why the execute?
# Nov 29th 2017, 21:06 saeideng limit(1)->execute()->first() :slightly_smiling_face:
# Nov 29th 2017, 21:06 inoas or even run them in background mode to get 10 items and then cache them in the db to be consumed
# Nov 29th 2017, 21:06 inoas basically to make web services that return data faster
# Nov 29th 2017, 21:05 inoas I want to cache responses of Http\Client ... serialize a good thing?
# Nov 29th 2017, 21:05 saeideng inoas
# Nov 29th 2017, 21:05 saeideng https://api.cakephp.org/3.5/source-class-Cake.Datasource.QueryTrait.html#402-421
# Nov 29th 2017, 21:05 inoas saeideng you can use formatResults to get the first item only instead of list of 1 items
# Nov 29th 2017, 21:05 saeideng $query->select(['id', 'username'])->first();
# Nov 29th 2017, 21:04 inoas saeideng yeah true
# Nov 29th 2017, 21:04 joopm and in my case no other
# Nov 29th 2017, 21:04 joopm or is there sometinh like matching but returns only the first?
# Nov 29th 2017, 21:03 joopm and its part of a matching
# Nov 29th 2017, 21:03 joopm i want only the first one
# Nov 29th 2017, 21:02 saeideng this returns array of result
# Nov 29th 2017, 21:02 joopm but using ->first() there
# Nov 29th 2017, 21:02 joopm this is the condition for the query
# Nov 29th 2017, 21:02 joopm ->where(['AND'=>[['Applications.state_id'=>2],['user_id'=>$this->Auth->User('id')]]]) //here does not works first();}
# Nov 29th 2017, 21:02 joopm i know that first return result not query
# Nov 29th 2017, 21:01 joopm Query builder for association "Applications" did not return a query
# Nov 29th 2017, 21:01 saeideng first return result not query
# Nov 29th 2017, 21:01 joopm first would be good but its says no query return
# Nov 29th 2017, 21:00 saeideng first returns "item"
# Nov 29th 2017, 20:59 saeideng limit returns [0 => item]
# Nov 29th 2017, 20:59 saeideng limit and first different