<?php

namespace Ignite\Core\Models\Grid;

use Ignite\Core\Models\Grid\AbstractTable;

abstract class QueryTable extends AbstractTable
{
    /**
     * Get the datatable instance.
     *
     * @param \Illuminate\Database\Query\Builder $query
     *
     * @return \Yajra\DataTables\DataTableAbstract
     */
    public function dataTable($query = null)
    {
        return $this->initDataTable($this->datatables->query($query ?? $this->query()));
    }
}
