mysql - cakephp3.0 pagination giving error for join table -


i using cakephp 3.0 , trying pagination result set 2 tables

$this->paginate = array(     'fields' => array(         'modifiergroups.id',         'modifiergroups.name',         'modifiergroups.type',         'modifiergroups.house_id',         'houses.name',                    ),     'conditions' => $search_filter,     'limit' => 18,     'order' => ['modifiergroups.name' => 'asc'],      'recursive'=>-1,       );  $this->paginate('modifiergroups') 

but it's giving me error

column not found: 1054 unknown column 'houses.name' in 'field list'

modeltable

$this->belongsto('houses', [     'foreignkey' => 'house_id' ]); 

you should use contain include 'houses', associated models no longer lazy loaded. recursive gone in cakephp3

http://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#eager-loading-associations


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -