2015-01-21 2 views
2

(group_id, member_id, city_id) 필드가있는 광고 테이블이 있습니다. 이것은 나의 GroupsController-> view 메소드이다.cakephp 3에 HasMany 관계가있는 페이지 매기기

public function view($id = null) { 
    $group = $this->Groups->get($id); 
    $this->paginate = ['conditions'=>['group_id'=>$id] , 'contain'=>['Members', 'Cities']]; 
    $advertisements = $this->paginate($this->Groups->Advertisements); 
    $this->set(compact('group' , 'advertisements')); 
} 

이 경고 메시지는 실제 결과 외에 생성됩니다.

Warning (4096): Argument 1 passed to Cake\Controller\Component\PaginatorComponent::validateSort() must be an instance of Cake\ORM\Table, instance of Cake\ORM\Association\HasMany given, called in D:\xampp\htdocs\project\vendor\cakephp\cakephp\src\Controller\Component\PaginatorComponent.php on line 153 and defined [CORE\src\Controller\Component\PaginatorComponent.php, line 301] 

무엇이 잘못 되었나요?

답변