Skip to content

Commit e4b6a4b

Browse files
committed
Rename ArrayGridView to DataSourceGridView
1 parent 2d2eb31 commit e4b6a4b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

wcfsetup/install/files/lib/system/view/grid/ArrayGridView.class.php renamed to wcfsetup/install/files/lib/system/view/grid/DataSourceGridView.class.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use LogicException;
66

7-
abstract class ArrayGridView extends AbstractGridView
7+
abstract class DataSourceGridView extends AbstractGridView
88
{
9-
protected array $dataArray;
9+
protected array $dataSource;
1010

1111
public function getRows(): array
1212
{
@@ -17,9 +17,9 @@ public function getRows(): array
1717

1818
protected function sortRows(): void
1919
{
20-
$this->getDataArray();
20+
$this->getDataSource();
2121

22-
\uasort($this->dataArray, function (array $a, array $b) {
22+
\uasort($this->dataSource, function (array $a, array $b) {
2323
if ($this->getSortOrder() === 'ASC') {
2424
return \strcmp($a[$this->getSortField()], $b[$this->getSortField()]);
2525
} else {
@@ -30,23 +30,23 @@ protected function sortRows(): void
3030

3131
protected function getRowsForPage(): array
3232
{
33-
return \array_slice($this->getDataArray(), ($this->getPageNo() - 1) * $this->getRowsPerPage(), $this->getRowsPerPage());
33+
return \array_slice($this->getDataSource(), ($this->getPageNo() - 1) * $this->getRowsPerPage(), $this->getRowsPerPage());
3434
}
3535

3636
public function countRows(): int
3737
{
38-
return \count($this->getDataArray());
38+
return \count($this->getDataSource());
3939
}
4040

41-
protected function getDataArray(): array
41+
protected function getDataSource(): array
4242
{
43-
if (!isset($this->dataArray)) {
44-
$this->dataArray = $this->loadDataArray();
43+
if (!isset($this->dataSource)) {
44+
$this->dataSource = $this->loadDataSource();
4545
$this->applyFilters();
4646
$this->fireInitializedEvent();
4747
}
4848

49-
return $this->dataArray;
49+
return $this->dataSource;
5050
}
5151

5252
protected function applyFilters(): void
@@ -57,11 +57,11 @@ protected function applyFilters(): void
5757
throw new LogicException("Unknown column '" . $key . "'");
5858
}
5959

60-
$this->dataArray = \array_filter($this->dataArray, function (array $row) use ($column, $value) {
60+
$this->dataSource = \array_filter($this->dataSource, function (array $row) use ($column, $value) {
6161
return $column->getFilter()->matches($value, $row[$column->getID()]);
6262
});
6363
}
6464
}
6565

66-
protected abstract function loadDataArray(): array;
66+
protected abstract function loadDataSource(): array;
6767
}

wcfsetup/install/files/lib/system/view/grid/ExceptionLogGridView.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use wcf\util\DirectoryUtil;
1414
use wcf\util\ExceptionLogUtil;
1515

16-
final class ExceptionLogGridView extends ArrayGridView
16+
final class ExceptionLogGridView extends DataSourceGridView
1717
{
1818
private array $availableLogFiles;
1919

@@ -62,7 +62,7 @@ public function getObjectID(mixed $row): mixed
6262
}
6363

6464
#[\Override]
65-
protected function loadDataArray(): array
65+
protected function loadDataSource(): array
6666
{
6767
if (!empty($this->getActiveFilters()['exceptionID'])) {
6868
$exceptionID = $this->getActiveFilters()['exceptionID'];

0 commit comments

Comments
 (0)