prepareForProcessing() публичный Метод

This will only be called when the DTProvider needs to handle the request. It will never be called when the DTProvider does not need to handle the request.
public prepareForProcessing ( OpenSkill\Datatable\Queries\QueryConfiguration $queryConfiguration, array $columnConfiguration ) : mixed
$queryConfiguration OpenSkill\Datatable\Queries\QueryConfiguration
$columnConfiguration array
Результат mixed
 public function testDefaultOrderMulti()
 {
     $data = [['id' => 1, 'name' => 'foo'], ['id' => 2, 'name' => 'bar'], ['id' => 3, 'name' => 'foo'], ['id' => 4, 'name' => 'bar']];
     $queryConfiguration = QueryConfigurationBuilder::create()->start(0)->length(4)->drawCall(1)->columnOrder('name', 'asc')->columnOrder('id', 'desc')->build();
     $columnConfiguration = ColumnConfigurationBuilder::create()->name('id')->build();
     $columnConfiguration2 = ColumnConfigurationBuilder::create()->name('name')->build();
     $provider = new CollectionProvider(new Collection($data));
     $provider->prepareForProcessing($queryConfiguration, [$columnConfiguration, $columnConfiguration2]);
     $data = $provider->process();
     $this->assertSame(4, $data->data()->count());
     $first = $data->data()->first();
     $second = $data->data()->get(1);
     $this->assertSame(4, $first['id']);
     $this->assertSame(2, $second['id']);
 }
 public function testCustomColumn()
 {
     $data = [['id' => 1, 'name' => 'foo'], ['id' => 2, 'name' => 'bar']];
     $queryConfiguration = QueryConfigurationBuilder::create()->start(0)->length(2)->columnSearch('id', 'foo')->drawCall(1)->build();
     $columnConfiguration = ColumnConfigurationBuilder::create()->name('id')->build();
     $provider = new CollectionProvider(new Collection($data));
     $provider->searchColumn('id', function ($data, $search) {
         // we only accept columns with the id 1 if the user searched in the column
         return $data['id'] == 1;
     });
     $provider->prepareForProcessing($queryConfiguration, [$columnConfiguration]);
     $data = $provider->process();
     $this->assertSame(1, $data->data()->count());
 }