# |
Jan 26th 2020, 00:22 |
luizcmarin |
update, pardon |
# |
Jan 26th 2020, 00:19 |
challgren |
Im not seeing your controller at all you have a file named controller but its a table |
# |
Jan 26th 2020, 00:14 |
luizcmarin |
https://gist.github.com/LuizMarin/9c7c9ede4251a3c8f96ddc645255e585 |
# |
Jan 26th 2020, 00:13 |
challgren |
And access is via $this->StiCaixas |
# |
Jan 26th 2020, 00:12 |
challgren |
You just need to set the $modelClass as the STI table |
# |
Jan 26th 2020, 00:12 |
challgren |
You can name the controller whatever you want |
# |
Jan 26th 2020, 00:12 |
luizcmarin |
or CaixaController ? |
# |
Jan 26th 2020, 00:11 |
luizcmarin |
@challgren StiCaixaController? (it's real table) |
# |
Jan 25th 2020, 23:38 |
challgren |
By default Cake is autoloading Caixa based on the controller name so you need to override the `$modelClass = 'StiCaixas';` in your controller |
# |
Jan 25th 2020, 23:33 |
slackebot |
!gist |
# |
Jan 25th 2020, 23:33 |
slackebot |
Command sent from Slack by challgren: |
# |
Jan 25th 2020, 23:33 |
challgren |
Do a gist of your controller I'll show you. Do it on GitHub so I can fork it |
# |
Jan 25th 2020, 23:33 |
challgren |
It's the same as $this-loadModel() in your controller |
# |
Jan 25th 2020, 23:31 |
challgren |
Ok override the $modelClass in your controller with the sticaixa table class name |
# |
Jan 25th 2020, 23:20 |
slackebot |
burned everything ... Then I started again from the beginning. It was then that I became convinced that this kind of thing cannot be done without real cooks. _* Realize that I don't write asking anything without making several attempts beforehand. I've dealt with support a lot and I know how stressful it is._ |
# |
Jan 25th 2020, 23:20 |
luizcmarin |
@challgren you understood well. So far I believe I have done everything right. But from there ..... I create a CaixaController, ContasPagarController, ContasReceberController? I created a CaixaController. He says' it doesn't exist in the database ". And it doesn't, he is right. I did not find HOW to make the menus and the screens. It is this side that I read all the material you gave me and tried to get the logic, ... but the cook here |
# |
Jan 25th 2020, 21:58 |
challgren |
@cakephp-slack does your /bin/cake.php match https://github.com/cakephp/app/tree/master/bin/cake.php? |
# |
Jan 25th 2020, 21:49 |
challgren |
Those types being Caixa, Caixapagar, Caixareceber, stored in the type column of your sti_caixas table in mySQL |
# |
Jan 25th 2020, 21:47 |
challgren |
@luizcmarin from my understanding you want to have 1 table with 3 different “types” stored? Those types are then converted by the ORM into Entities that are different? Is that correct? |
# |
Jan 25th 2020, 21:32 |
luizcmarin |
STI.... |
# |
Jan 25th 2020, 21:05 |
latenal |
Hi! I am trying to integrate a JWT authentication using the `Authentication` plugin. I read the docs and I don’t quite understand how it works. ``` public function login() { $this->request->allowMethod(['get', 'post']); $result = $this->Authentication->getResult(); if (!$result->isValid()) { throw new ForbiddenException(__('The username and password don\'t match.')); } }``` |
# |
Jan 25th 2020, 20:17 |
luizcmarin |
@challgren Excuse me. I started the STI all over again. It is impossible to continue alone without overloading the support. Difficult to implement with readme.md and does not explain how to continue. I tried every dumb way I know. I will think of alternatives. |
# |
Jan 25th 2020, 12:30 |
alexdd55976 |
its cake 3.6 |
# |
Jan 25th 2020, 12:29 |
alexdd55976 |
`NOT IN`?? |
# |
Jan 25th 2020, 12:29 |
alexdd55976 |
am i wrong with the statement? |
# |
Jan 25th 2020, 12:29 |
alexdd55976 |
there are tracking_ids in the variable. |
# |
Jan 25th 2020, 12:27 |
alexdd55976 |
but get this `Impossible to generate condition with empty list of values for field (tracking_id)`v |
# |
Jan 25th 2020, 12:27 |
alexdd55976 |
trying to do this ```$Times->deleteAll([ 'Times.model_id' => 7, 'Times.model_primary_key' => $entity->id, 'Times.tracking_id NOT IN' => $tracking_ids ]);``` |
# |
Jan 25th 2020, 12:27 |
alexdd55976 |
hey fellows |
# |
Jan 25th 2020, 10:24 |
challgren |
@luizcmarin we updated the README.md to include setTable instead of table. Also you may want to be looking at https://github.com/UseMuffin/Sti/tree/cake-4.x as thats more specific to Cake 4 and the master branch is for 3.6+ |
# |
Jan 25th 2020, 00:27 |
luizcmarin |
very complex, I am confused and tired. Tomorrow I try to start again. The plugin is good, congratulations to those who did it. But my knowledge and ability to understand are greatly reduced. Thanks for the help @challgren. Willing people like you and some of the support is what dignifies the "kitchen of the cake". Good evening. |
# |
Jan 24th 2020, 23:44 |
luizcmarin |
examinando |
# |
Jan 24th 2020, 23:43 |
challgren |
The tests show you how to use it in a more technical sense and what to expect |
# |
Jan 24th 2020, 23:39 |
luizcmarin |
mamma mia.... moment, muuuch moments :tired_face: |
# |
Jan 24th 2020, 23:33 |
challgren |
https://github.com/UseMuffin/Sti/blob/master/tests/TestCase/Model/Behavior/StiBehaviorTest.php#L36 |
# |
Jan 24th 2020, 23:33 |
challgren |
https://github.com/UseMuffin/Sti/blob/master/tests/test_app/Model/Table/CooksTable.php |
# |
Jan 24th 2020, 23:32 |
challgren |
https://github.com/UseMuffin/Sti/blob/master/tests/TestCase/Model/Behavior/StiBehaviorTest.php#L46 |
# |
Jan 24th 2020, 23:30 |
challgren |
Yes, you just need to use the sti_caixas table to do your queries. The find/get will return the corrected entity type |
# |
Jan 24th 2020, 23:29 |
luizcmarin |
but can i create a menu for each type? and the screens too? |
# |
Jan 24th 2020, 23:28 |
challgren |
You wont have tables called caixa, caixapagar, and caixareceber. Those are entities. The sti_caixas table is what holds your data |
# |
Jan 24th 2020, 23:27 |
luizcmarin |
now i'm really confused. Give me time to understand your concept and test it out. |