Log message #4108717

# At Username Text
# Jan 13th 2018, 11:05 technofection Hi, I am trying to create a resource map like this 'map' => [ '/search/:page/:records/*' => [ 'action' => 'index', 'method' => 'GET' ], .... .... I want to set regular expression for the URL parameters... What is the syntax?
# Jan 13th 2018, 01:44 mdotobie Actually scratch that question. I just realized there is another approach I can take
# Jan 13th 2018, 01:34 mdotobie is there a way to access the ServerRequest object from a Form object in CakePHP 3.5
# Jan 12th 2018, 23:15 obinoob *supposed
# Jan 12th 2018, 23:14 obinoob admad thank you meanwhile I've used a for loop in my ajax call but tomorrow I'll read the api carefully I'm so blind by now! I'm not sure how it's suppose to change date format on a batch of records... suppose I need to use a for loop right?
# Jan 12th 2018, 21:04 admad Err obinoob
# Jan 12th 2018, 21:04 admad opinion: use this in bootstrap https://api.cakephp.org/3.5/class-Cake.I18n.DateFormatTrait.html#_setJsonEncodeFormat
# Jan 12th 2018, 20:23 obinoob my javascript application is expecting a json value to be a date startDate: Sat Aug 25 2018 00:00:00 GMT+0100 (WEST) but cakephp is returning string startDate: "2018-01-12T19:55:58+00:00" is there a way I can do this from server side or I will have to loop data with javascript and make my things?
# Jan 12th 2018, 18:54 maymeow anyone have good travis config file for cakephp (with mysql service) ?
# Jan 12th 2018, 18:22 DJTrey i have a cakephp site that has wordpress in the webroot. it keeps redirecting to /webroot/blog. can someone please take a look if you have a chance? here's my htaccess https://stackoverflow.com/questions/48229945/wordpress-blog-inside-of-cakephp-keeps-redirecting-to-webroot-blog
# Jan 12th 2018, 16:36 beakman Or some sorta join which would might end up a bit more efficient.
# Jan 12th 2018, 16:35 beakman @bigdaddygee Might be able to shove a subquery somewhere in there too.
# Jan 12th 2018, 16:35 bigdaddygee Maybe yes, but I just don't understand why this not working. but thanks :slightly_smiling_face:
# Jan 12th 2018, 16:35 beakman https://book.cakephp.org/3.0/en/orm/behaviors/counter-cache.html
# Jan 12th 2018, 16:34 beakman @bigdaddygee Might just want to use a counter cache for that.
# Jan 12th 2018, 16:31 bigdaddygee ``` $Stores = $this->Stores ->find() ->select(['UserStores.Count' => function(\Cake\ORM\Query $q) { return $q->func()->count('*'); }]) ->contain([ 'CreatedByUsers', 'ModifiedByUsers', 'Users', 'UserStores', 'Images' ]); ```
# Jan 12th 2018, 16:31 bigdaddygee Humm, do someone know how I can inject a count of another table into a resultset ? (Actualy I got the list instead of the count)
# Jan 12th 2018, 16:19 neon1024 https://book.cakephp.org/3.0/en/orm/query-builder.html#automatically-creating-in-clauses
# Jan 12th 2018, 16:18 danishkhan3621 is there any link of tutorials where i can get fetching result of these types.
# Jan 12th 2018, 16:17 neon1024 Still, at least there is finally a `.forEach()`
# Jan 12th 2018, 16:16 neon1024 Well, I suppose technically it’s a hash of objects as strictly speaking Javascript doesn’t have arrays
# Jan 12th 2018, 16:16 danishkhan3621 @neon1024: Thanks
# Jan 12th 2018, 16:15 neon1024 So you’ll have to fix that ;)
# Jan 12th 2018, 16:15 neon1024 It’s an array of objects
# Jan 12th 2018, 16:15 neon1024 What you’ve got there is JSON
# Jan 12th 2018, 16:14 neon1024 This is not an array unfortunatly, `My array is [{"category_id":1},{"category_id":4}] `
# Jan 12th 2018, 16:14 neon1024 Yeah, of course
# Jan 12th 2018, 16:14 danishkhan3621 this does not return any result because i have to assign category_id key to an array
# Jan 12th 2018, 16:13 danishkhan3621 @neon1024: `$get_all_categories_prd_id = $this->Products->find('all',array('conditions'=>array('category_id IN'=>$get_all_categories_p_id)));`
# Jan 12th 2018, 16:10 neon1024 But that’s personal preference
# Jan 12th 2018, 16:10 neon1024 You should also really consider changing your variable names to use the CakePHP coding standard
# Jan 12th 2018, 16:10 danishkhan3621 @neon1024: is there any other way to do it without loop.
# Jan 12th 2018, 16:09 neon1024 There is also no need to use a loop, as you can just transform the array and use `'id IN' => $array`
# Jan 12th 2018, 16:09 neon1024 You should also not use `count()` in a for loop as it causes count to be executed in every iteration
# Jan 12th 2018, 16:08 neon1024 If your array is JSON, you might struggle to use it in PHP ;)
# Jan 12th 2018, 16:08 neon1024 <- Click the [+] button and click on the ‘Code or text snippet’
# Jan 12th 2018, 16:02 danishkhan3621 How can i run find query to search records from an array : My array is [{"category_id":1},{"category_id":4}] and i'm running query like this for($i=0; $i<count($get_all_categories_p_id); $i++) { $get_all_categories_prd_id = $this->Products->find('all',array('conditions'=>array('category_id IN'=>$get_all_categories_p_id[$i]['category_id']))); $product_List[]=$get_all_categories_prd_id; }
# Jan 12th 2018, 15:34 jotpe is there any possibility to run composers `post-update-cmd` for _production_ or _development_?
# Jan 12th 2018, 15:22 xavier83ar ok, thanks!
# Jan 12th 2018, 15:20 jota then rollback
# Jan 12th 2018, 15:20 jota got the query