Esempio n. 1
0
 /**
  * Handle delete process
  *
  * @param $postData
  */
 protected function processDelete($postData)
 {
     $keys = $this->getTablePrimaryKeys();
     $clause = collect($postData)->only($keys)->toArray();
     Queries::delete($this->getTable(), $clause);
 }
Esempio n. 2
0
 /**
  * Return the columns listed in the overrided list query
  *
  * @return array
  */
 private function getOverridedQueryColumns()
 {
     return Queries::getQueryColumns($this->getCustomDatatableQuery());
 }
Esempio n. 3
0
 /**
  * Return the select options from a database table
  *
  * @return array
  */
 private function getTableOptions()
 {
     $rows = Queries::getTableRows($this->table, [$this->keyColumn, $this->descriptionColumn]);
     $options = collect();
     foreach ($rows as $row) {
         $options->push($this->createOption($row->{$this->keyColumn}, $row->{$this->descriptionColumn}));
     }
     return $options->toArray();
 }
Esempio n. 4
0
 public static function getTablePrimaryKeys($table)
 {
     return Queries::getTablePrimaryKeys($table);
 }