# |
Mar 12th 2018, 15:46 |
dorxy |
@learningcake it also depends where exectly you execute the write and read |
# |
Mar 12th 2018, 15:45 |
raul338 |
should be getQuery / getData ? |
# |
Mar 12th 2018, 15:45 |
learningcake |
I created a method that searches database base on id parameter |
# |
Mar 12th 2018, 15:43 |
raul338 |
why getParam('id') ? |
# |
Mar 12th 2018, 15:43 |
learningcake |
any idea why my session doesn't work? |
# |
Mar 12th 2018, 15:35 |
kitcat711 |
thx |
# |
Mar 12th 2018, 15:35 |
kitcat711 |
raul338: the error was the return inside the map |
# |
Mar 12th 2018, 15:33 |
learningcake |
when I move to the next page, debugs show false |
# |
Mar 12th 2018, 15:33 |
learningcake |
$this->request->session()->write('User.id',$this->request->getParam('id')); $id = $this->request->session()->read('User.id'); debug($id); |
# |
Mar 12th 2018, 15:32 |
learningcake |
is it possible for pagination to destroy session when I move to the next page? |
# |
Mar 12th 2018, 15:31 |
raul338 |
also the return inside the map |
# |
Mar 12th 2018, 15:31 |
raul338 |
you're missing hydrate(false) in the second example |
# |
Mar 12th 2018, 15:28 |
kitcat711 |
raul338: I think (see gist) |
# |
Mar 12th 2018, 15:27 |
kitcat711 |
easier with my gist |
# |
Mar 12th 2018, 15:27 |
kitcat711 |
https://gist.github.com/Kitcat711/b22fb783382e2bc9d22b9025d21f20ca |
# |
Mar 12th 2018, 15:24 |
raul338 |
are you returning the $query in the finder? |
# |
Mar 12th 2018, 15:23 |
kitcat711 |
no error, but no results too |
# |
Mar 12th 2018, 15:22 |
kitcat711 |
I spoke to quicly |
# |
Mar 12th 2018, 15:09 |
kitcat711 |
found my way out |
# |
Mar 12th 2018, 15:09 |
kitcat711 |
thx dorxy |
# |
Mar 12th 2018, 15:07 |
dorxy |
@kitcat711 https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#custom-finder-methods |
# |
Mar 12th 2018, 15:05 |
kitcat711 |
I am on 3.5 |
# |
Mar 12th 2018, 14:59 |
raul338 |
I do not konw about cakephp2 |
# |
Mar 12th 2018, 14:59 |
raul338 |
in cakephp3 in the table class |
# |
Mar 12th 2018, 14:59 |
kitcat711 |
where do I define my fonder: model or entity ? |
# |
Mar 12th 2018, 14:58 |
kitcat711 |
thx raul338 |
# |
Mar 12th 2018, 14:56 |
raul338 |
you should use a finder, when you want formatResults you call `$query->find('customFormat')` |
# |
Mar 12th 2018, 14:54 |
kitcat711 |
When using formatResults(..), is there a way to define the format or do I need to rewrite everytime the format function ? |
# |
Mar 12th 2018, 14:53 |
kitcat711 |
Hello |
# |
Mar 12th 2018, 14:50 |
learningcake |
thank you guys for the help |
# |
Mar 12th 2018, 14:42 |
Neon1024 |
Here, https://irc.cakephp.org/logs/link/4124154#message4124164 |
# |
Mar 12th 2018, 14:42 |
raul338 |
you should use a client that keeps history :P |
# |
Mar 12th 2018, 14:42 |
learningcake |
ok. thank you. let me read up on the link and follow your example |
# |
Mar 12th 2018, 14:42 |
raul338 |
I said "you can also set contain into $paginate options (maybe it was $pagination)" |
# |
Mar 12th 2018, 14:41 |
learningcake |
@neon1023, no |
# |
Mar 12th 2018, 14:41 |
Neon1024 |
`$query = $this->Examples->find()->contain(['Foo', 'Bar'])->matching('Foo', function () { //Stuff }); $this->Paginator->paginate($query)` |
# |
Mar 12th 2018, 14:41 |
Neon1024 |
@learningcake, You can just pass a query into the Paginator. So just apply the matching() to your query and pass it in |
# |
Mar 12th 2018, 14:40 |
neon1024 |
I did! Did the bot relay the message? |
# |
Mar 12th 2018, 14:40 |
learningcake |
hello @raul338, sorry my internet connection broke. trying to get your comment from history. I don't know if any other person responded. |
# |
Mar 12th 2018, 14:40 |
neon1024 |
https://book.cakephp.org/3.0/en/controllers/components/pagination.html#using-the-paginator-directly |
# |
Mar 12th 2018, 14:38 |
raul338 |
(maybe it was $pagination) |