Log message #4116448

# At Username Text
# Feb 11th 2018, 20:49 rafael.junqueira.sant I read the code over and over again and didn't understand what I am doing wrong.
# Feb 11th 2018, 20:44 rafael.junqueira.sant Hello, I have the following error: https://pastebin.com/iUAWeFDv What am I doing wrong?
# Feb 11th 2018, 19:37 dereuromark Ah, looking into the code one need file key here it seems
# Feb 11th 2018, 19:25 dereuromark Did anyone achieve logging to a custom bounce.log etc? I couldnt with latest master.. always went straight to debug.log ( https://github.com/dereuromark/CakePHP-DatabaseLog/blob/master/docs/README.md#setting-up-a-custom-type ), but that shouldnt happen with 'scopes' => false config. Confusing.
# Feb 11th 2018, 19:12 kitcat711 anyone? hw can i avoid the foreach please?
# Feb 11th 2018, 18:52 maymeow how can i create controller withou database table???
# Feb 11th 2018, 18:50 kitcat711 howw can I avoid the foreach just after my query by integrating it?
# Feb 11th 2018, 18:49 kitcat711 Optimisation : https://gist.github.com/anonymous/bdb0daeb357ee1048dba3b1557708708
# Feb 11th 2018, 18:07 amit I am using mark story asset compress plugin, while doing build I am getting java error
# Feb 11th 2018, 18:06 amit Hi All anyone around
# Feb 11th 2018, 16:36 maymeow and user resource looks like this: ``` class UserResource extends Resource { public function toArray() { return [ 'id' => $this->entity->id, 'email' => $this->entity->email, 'profile' => function ($q) { return (new ProfileResource($q->profile))->get(); }, 'created_at' => $this->entity->created ]; } } ```
# Feb 11th 2018, 16:32 maymeow @admad ill look at this
# Feb 11th 2018, 16:32 slackebot1 "image": "img\/profile.png", "bio": null, "facebook": null, "twitter": null, "user_id": 1 }, "created_at": "2018-02-11T16:27:12+00:00" }, "created_at": "2018-02-11T16:27:59+00:00" } ] } ```
# Feb 11th 2018, 16:32 slackebot1 => $this->entity->created, ]; } } ``` return this ``` { "posts": [ { "id": 1, "title": "Another issue", "body": "test", "markdown": "\u003Cp\u003Etest\u003C\/p\u003E", "user": { "id": 1, "email": "may@example.com", "profile": { "id": 1, "name": "may@example.com",
# Feb 11th 2018, 16:32 maymeow another example ``` class PostResource extends Resource { public function toArray() { return [ 'id' => $this->entity->id, 'title' => $this->entity->title, 'body' => $this->entity->body, 'markdown' => (new Parsedown)->text($this->entity->body), 'user' => function ($q) { return (new UserResource($q->user))->get(); }, 'created_at'
# Feb 11th 2018, 16:21 admad @maymeow https://github.com/FriendsOfCake/crud-json-api
# Feb 11th 2018, 15:55 maymeow so i can manage api in one file ... and whatever i use resource i still have same model
# Feb 11th 2018, 15:54 dereuromark @maymeow most apis use "contain" key to include relations
# Feb 11th 2018, 15:54 maymeow tnis is first version...
# Feb 11th 2018, 15:54 slackebot1 !tell K4T about awesome
# Feb 11th 2018, 15:54 slackebot1 Command sent from Slack by dereuromark:
# Feb 11th 2018, 15:54 slackebot1 => ['projects'] ]); } ```
# Feb 11th 2018, 15:54 slackebot1 ProfileResource($q->profile))->get(); }, 'modified_at' => $this->entity->modified, 'created_at' => $this->entity->created, ]; } } ``` next in my api controller can call ``` public function projects($id = null) { $user = $this->Users->get($id); $projects = ProjectResource::collection($user->projects); $this->set([ 'projects' => $projects, '_serialize'
# Feb 11th 2018, 15:54 maymeow @dereuromark just trying ways to create api. for example i have creaated api resource class -> my projects ``` class ProjectResource extends Resource { public function toArray() { return [ 'id' => $this->entity->id, 'name' => $this->entity->name, 'description' => $this->entity->description, 'profile' => function ($q) { return (new
# Feb 11th 2018, 15:53 K4T do we have any solutions in CakePhP3 which allow us to track/keep history of changes in table?
# Feb 11th 2018, 15:50 loginews can anyone give me a hint on my dateFormat question ?
# Feb 11th 2018, 15:48 admad https://github.com/jeremyharris/cakephp-lazyload/
# Feb 11th 2018, 15:48 admad https://github.com/jeremyharris/cakephp-lazyload/
# Feb 11th 2018, 15:36 dereuromark can be done, but why? :slightly_smiling_face:
# Feb 11th 2018, 15:31 maymeow @dereuromark what about loading asociated models with virtual properties?
# Feb 11th 2018, 15:06 admad @rochasmarcelo fixed, thanks for reporting
# Feb 11th 2018, 14:26 loginews File uploaded https://cakesf.slack.com/files/U435V89H8/F985Z2CGN/-.txt / https://slack-files.com/T053DPNCM-F985Z2CGN-b1cfe37bb0 - The above input still displays the field in YMD format. What did I miss ?
# Feb 11th 2018, 13:53 maymeow any other idea how to create api??? (i need there some virtuaal fields).... But without installing 3rd party plugins... it will looks like wordpress where i want one button in template aand need install 30 plugins :)
# Feb 11th 2018, 13:16 maymeow im using both of frameworks
# Feb 11th 2018, 13:16 maymeow i do not
# Feb 11th 2018, 13:15 K4T please do not start another religious war ;d
# Feb 11th 2018, 13:12 dereuromark @maymeow thats an antipattern usually :slightly_smiling_face:
# Feb 11th 2018, 13:00 maymeow is there any way (like in laravel) anytime i call associated model to get data??? (Without using contain in query)... ???
# Feb 11th 2018, 12:56 K4T each entity new flag back to false*
# Feb 11th 2018, 12:55 K4T which are not new. Is there a wy which allow me to solve that puzzle without reiterating whole entities array after first save and set each intity flag back to false?
# Feb 11th 2018, 12:55 K4T I need to store the same entities in two different tables with the same structure. Tables are: tab_a and tab_a_history. My problem is that when I save array of entities to tab_a all entities are modified (marked as saved) by save method (flag new is set to false in each entity etc). Becuase of that I can not call save on second table becuase ::save method will not execute sql for entities