Log message #4155730

# At Username Text
# Jul 4th 2018, 14:22 josbeir GuilHermeD: cake 2 i assume ?
# Jul 4th 2018, 14:22 GuilhermeD In table organograma_item, i have the field "organograma_item_parent_fk"
# Jul 4th 2018, 14:21 GuilhermeD Hi! https://pastebin.com/yNMxgZ4c - Is there a way to save it recursively? They are relationed by the same model.
# Jul 4th 2018, 14:20 josbeir @ojtibi you mean, for instance an extended class of the CakeRequest class ?
# Jul 4th 2018, 13:59 ojtibi Hello! Has anyone here tried to replace CakeRequest without overwriting the core? I'm on 2.x at the moment and trying to replace it with an app-specific one. I saw Mark Story's post that it's possible to do it with CakeResponse, but I haven't seen anything like it for CakeRequest.
# Jul 4th 2018, 13:58 mark Hi @admad, I'm curious if there's a way to do it on AppController. :) seems possible.
# Jul 4th 2018, 13:56 ojtibi :wave:
# Jul 4th 2018, 13:55 neon1024 Is this a bad plan?
# Jul 4th 2018, 13:55 neon1024 So I could literally get the children of that block, so it would work like actual inheritance
# Jul 4th 2018, 13:54 neon1024 I was thinking perhaps parent child self referencing association in ScriptBlocks?
# Jul 4th 2018, 13:54 neon1024 The requirement is that they inherit from a Master Script, and blocks can be individually overwritable in child scripts
# Jul 4th 2018, 13:53 neon1024 I have a software requirement that I’m struggling to figure out. I am creating Scripts, a spoken script this is. They are comprised of Script Blocks.
# Jul 4th 2018, 13:25 josbeir i think i only used that once or twice myself
# Jul 4th 2018, 13:25 lubos i am sure it is :slightly_smiling_face: will have more play when there is time :slightly_smiling_face:
# Jul 4th 2018, 13:25 josbeir it is more straightforward but mapreduce is pretty powerfull too :slightly_smiling_face:
# Jul 4th 2018, 13:25 lubos in compare to mapReduce
# Jul 4th 2018, 13:24 lubos I think so too, for me it is much easier to use
# Jul 4th 2018, 13:24 josbeir but it is very complex to gras for new folks
# Jul 4th 2018, 13:24 josbeir formatResults should imo be more emphasised in documentation, most things refer to map reduce
# Jul 4th 2018, 13:23 josbeir glad it worked! :slightly_smiling_face:
# Jul 4th 2018, 13:23 lubos File uploaded https://cakesf.slack.com/files/UBEC23Z6H/FBKV67PMM/-.txt / https://slack-files.com/T053DPNCM-FBKV67PMM-3580021e0c - <@UAG1HNWKT> and <@U51A5M2DS> thanks for help with formatResults, it works like a dream ... here is what I came up with
# Jul 4th 2018, 13:22 lubos File uploaded https://cakesf.slack.com/files/UBEC23Z6H/FBJB85FJM/-.txt / https://slack-files.com/T053DPNCM-FBJB85FJM-298ade22c6
# Jul 4th 2018, 13:03 lubos at form with $offer entity
# Jul 4th 2018, 13:03 lubos @pmoraes `$this->Form->control('suppressed._ids')`
# Jul 4th 2018, 13:02 neon1024 You’ll need to tell Cake to use your new class, where ever that is, I guess in your Acl configuration
# Jul 4th 2018, 12:30 pmoraes @lubos and your form how is it?
# Jul 4th 2018, 12:02 mark alright. :)
# Jul 4th 2018, 11:57 admad so will need proper check to decide when to extend
# Jul 4th 2018, 11:56 admad but thats hackish and you could end up with a loop if not careful
# Jul 4th 2018, 11:55 mark alright, :) let me figure that out. thank you admad!
# Jul 4th 2018, 11:54 ldsign Can you have a look?
# Jul 4th 2018, 11:54 ldsign namespace App\Model\Entity; use Acl\Model\Entity\Aco as ParentAco; class Aco extends ParentAco { protected $_virtual = ['text']; /** * Create virtual field "text" * * @return string text */ protected function _getText() { if (empty($this->_properties['text'])) { return $this->_properties['alias']; } return $this->_properties['text']; } }
# Jul 4th 2018, 11:54 ldsign Thanks - Ive tried that but it does not work :(
# Jul 4th 2018, 11:52 admad @mark you can try overring View::_evaluate() and adding the `extend()` call before `include` statement
# Jul 4th 2018, 11:50 mark oops
# Jul 4th 2018, 11:50 cliper hi guys, trying to sort this out quick, so im pasting into multiple support channels atm
# Jul 4th 2018, 11:48 mark Hi guys, just a quick question. :) is there a way to extend a view template in AppView class? I'm looking for a solution on not repeating any code that I put in my template.ctp file that looks like this: $this->extend('../Layout/TwitterBootstrap/dashboard'); and want to move it to AppView so I could just define like, if ($this->requests->controller) are Pages, Dealers, or whatever I could just use that extend statement there.. :)
# Jul 4th 2018, 11:31 josbeir $request = $this->getRequest()->withData('key', 'value'); $this->setRequest($request); $this->Crud->execute();
# Jul 4th 2018, 11:30 josbeir if you really want to manipulate request data in your controller you could just do that in your action and then call $this->Crud->execute(), havent done that myself but should work
# Jul 4th 2018, 11:28 josbeir but if we are talking about marshalling, beforeMarshal will probably be fine in most cases i think
# Jul 4th 2018, 11:27 josbeir not really, beforeSave can be used to perform controller logic before saving