Skip to content

Commit

Permalink
fixed performance issue of ActiveRow [Closes #312]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 9, 2025
1 parent 49e3860 commit ea292d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Database/Table/Selection.php
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ public function getReferencingTable(string $table, ?string $column = null, $acti
if (!$prototype) {
$prototype = $this->createGroupedSelectionInstance($table, $column);
$prototype->where("$table.$column", array_keys((array) $this->rows));
$prototype->getSpecificCacheKey();
}

$clone = clone $prototype;
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/Explorer/Explorer.cache.observer.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Nette\Database\Helpers::loadFromFile($connection, __DIR__ . "/../files/{$driverN

$cacheStorage = Mockery::mock(Nette\Caching\Istorage::class);
$cacheStorage->shouldReceive('read')->withAnyArgs()->once()->andReturn(['id' => true]);
$cacheStorage->shouldReceive('read')->withAnyArgs()->times(4)->andReturn(['id' => true, 'author_id' => true]);
$cacheStorage->shouldReceive('read')->withAnyArgs()->times(2)->andReturn(['id' => true, 'author_id' => true]);
$cacheStorage->shouldReceive('write')->with(Mockery::any(), ['id' => true, 'author_id' => true, 'title' => true], []);

$explorer = new Nette\Database\Explorer($connection, $structure, $conventions, $cacheStorage);
Expand Down

0 comments on commit ea292d5

Please sign in to comment.