QuickTable: gracefully handle missing columns

This commit is contained in:
Thomas Gelf 2015-08-28 16:49:48 +02:00
parent 99dfe54637
commit 5d643534ad
1 changed files with 8 additions and 1 deletions

View File

@ -35,7 +35,14 @@ abstract class QuickTable implements Paginatable
$firstRow = true; $firstRow = true;
foreach ($this->getTitles() as $key => $title) { foreach ($this->getTitles() as $key => $title) {
$val = $row->$key;
// Support missing columns
if (property_exists($row, $key)) {
$val = $row->$key;
} else {
$val = null;
}
$value = null; $value = null;
if ($firstRow) { if ($firstRow) {