# |
Jul 4th 2018, 14:24 |
GuilhermeD |
SQL Query: INSERT INTO `sesa_migracao_organograma`.`organograma_item` (`organograma_item_fk`) VALUES (39) |
# |
Jul 4th 2018, 14:24 |
josbeir |
in theory it should work if the dataset is compatible |
# |
Jul 4th 2018, 14:24 |
josbeir |
with an error? |
# |
Jul 4th 2018, 14:24 |
GuilhermeD |
josbeir: I've tryed saveAssociated with deep set as true. But when it try to saves a 2nd level, it breaks. |
# |
Jul 4th 2018, 14:23 |
josbeir |
https://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveall-array-data-null-array-options-array |
# |
Jul 4th 2018, 14:23 |
josbeir |
saveAll() ? |
# |
Jul 4th 2018, 14:22 |
GuilhermeD |
Yes |
# |
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 |