public function listColumns($table, array $exclude = null) { $columns = $this->db->connection()->getDoctrineSchemaManager()->listTableColumns($table); $columns = array_map(function ($column) { return $column->getName(); }, $columns); $result = array_exclude($columns, $exclude); return $result; }
public function columns(Model $model) { $cols = $this->getTableColumns($model); $except = array_merge($model->getHidden(), $this->dataTableExceptColumns ?: []); $append = $this->dataTableAppendColumns ?: []; $result = array_merge(array_exclude($cols, $except), $append); $result = array_unique($result); return $result; }
public function testArrayExclude() { $arrayA = array('foo', 'bar', 'baz'); $arrayB = array('bar'); $expected = array('foo', 'baz'); $actual = array_exclude($arrayA, $arrayB); $this->assertEquals($expected, $actual); $arrayB = array('bar', 'baz'); $expected = array('foo'); $actual = array_exclude($arrayA, $arrayB); $this->assertEquals($expected, $actual); }
// We need to disable the elements so they are not submitted in the POST $('#address' + row).prop("disabled", hide); $('#address_subnet' + row).prop("disabled", hide || disable_subnets); $('#detail' + row).prop("disabled", hide); $('#deleterow' + row).prop("disabled", hide); } // On load . . typechange(); // Suppress "Delete row" button if there are fewer than two rows checkLastRow(); // Autocomplete var addressarray = <?php echo json_encode(array_exclude($pconfig['name'], get_alias_list($pconfig['type']))); ?> ; $('[id^=address]').autocomplete({ source: addressarray }); // on click . . $('#type').on('change', function() { typechange(); }); }); //]]> </script>