PGBI / cakephp3-soft-delete

83 stars 60 forks source link

pagination can't view softDeleted item. #24

Open akutaktau opened 7 years ago

akutaktau commented 7 years ago

Hi, I'm trying to display softDeleted item on pagination. it seems doesn't work to me.

$this->paginate = [ 'contain' => ['Users', 'WeatherCategories'], 'order' => [ 'Posts.created DESC' ], 'limit' => 50 ]; }

$posts = $this->paginate($this->Posts->find('all',['withDeleted']))->toArray();

or

$this->paginate = [ 'withDeleted', 'contain' => ['Users', 'WeatherCategories'], 'order' => [ 'Posts.created DESC' ], 'limit' => 50 ]; }

$posts = $this->paginate($this->Posts->find())->toArray();

is there a way just to display the softdeleted item?

Petrucheqa commented 7 years ago

Try this :

$this->paginate = [
            'finder' => [
                'all' => $customFinderOptions
            ]
        ];

But this syntax should work :

 $this->paginate($this->Posts->find('all', ['withDeleted']));