Category: Models & ORM

How to find users between two ages?

I want to find all users between two ages, could someone help me?$age_from = $this->request->query['age_from']; $age_to = $this->request->query['age_to']; //transform to date format?

SOLVED #age #tablerigistry
2 Answers
Kristi
Kristi

137

Category: Models & ORM

Using cakephp/elastic-search with pagination

How do you use the elastic-search plugin with cake's native pagination?before filter:$this->loadModel('Products', 'Elastic');in controller:$this->paginate = [   'limit' => 10, '

SOLVED #elasticsearch #plugin #pagination
1 Answers

Category: Models & ORM

Work with contain hasMany association and to retrieve particular fields only?

I'd like to know how to retrieve particular fields in the associated table when using containable queries? To be more specified, I have the following tables: Posts, Users that a user may have one or m

SOLVED #contain #association #hasmany
1 Answers
Kristi
Kristi

137

Category: Models & ORM

Table::get($name)->hasAny(['key' => 'value'] is not working in cakephp 3

Cake shows error unknown method "hasAny" when checking a record exists or not. Neither this..TableRegistry::get('Posts')->hasAny(['Post.id' => 1]);or that$this->Posts->hasAny(array(['Post.

SOLVED
1 Answers
Kristi
Kristi

137