Skip to content

Commit 2c39ac7

Browse files
committed
Removing calls to Factory::getApplication and getDbo
1 parent 7a4097b commit 2c39ac7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

administrator/components/com_finder/src/Controller/IndexController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ public function optimise()
5252
$this->checkToken();
5353

5454
// Optimise the index by first running the garbage collection
55-
$app = Factory::getApplication();
5655
PluginHelper::importPlugin('finder');
57-
$app->triggerEvent('onFinderGarbageCollection');
56+
$this->app->triggerEvent('onFinderGarbageCollection');
5857

5958
// Now run the optimisation method from the indexer
6059
$indexer = new Indexer;

administrator/components/com_finder/src/Indexer/Adapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function onBuildIndex()
271271
*/
272272
public function onFinderGarbageCollection()
273273
{
274-
$db = Factory::getDbo();
274+
$db = $this->db;
275275
$type_id = $this->getTypeId();
276276

277277
$query = $db->getQuery(true);
@@ -396,7 +396,7 @@ protected function remove($id, $removeTaxonomies = true)
396396
// Check the items.
397397
if (empty($items))
398398
{
399-
Factory::getApplication()->triggerEvent('onFinderIndexAfterDelete', array($id));
399+
$this->app->triggerEvent('onFinderIndexAfterDelete', array($id));
400400

401401
return true;
402402
}

0 commit comments

Comments
 (0)