getInvoices() public method

public getInvoices ( $accountId, $clientPublicId = false, $entityType = ENTITY_INVOICE, $filter = false )
 public function getDatatable($accountId, $clientPublicId = null, $entityType, $search)
 {
     $datatable = new InvoiceDatatable(!$clientPublicId, $clientPublicId);
     $datatable->entityType = $entityType;
     $query = $this->invoiceRepo->getInvoices($accountId, $clientPublicId, $entityType, $search)->where('invoices.invoice_type_id', '=', $entityType == ENTITY_QUOTE ? INVOICE_TYPE_QUOTE : INVOICE_TYPE_STANDARD);
     if (!Utils::hasPermission('view_all')) {
         $query->where('invoices.user_id', '=', Auth::user()->id);
     }
     return $this->datatableService->createDatatable($datatable, $query);
 }