From 3c51af78a277e865848b86e9b3048edcc9c6dbf7 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 23 Jan 2025 09:35:46 +0000 Subject: [PATCH] Replace DBA class with DI::dba() in Item Model --- src/Model/Item.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 5fdc57647f..f9ab920bf0 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -769,7 +769,7 @@ class Item $params = ['order' => ['id' => false]]; $parent = Post::selectFirst($fields, $condition, $params); - if (!DBA::isResult($parent) && Post::exists(['uri-id' => [$item['thr-parent-id'], $item['parent-uri-id']], 'uid' => 0])) { + if (!DI::dba()->isResult($parent) && Post::exists(['uri-id' => [$item['thr-parent-id'], $item['parent-uri-id']], 'uid' => 0])) { $stored = Item::storeForUserByUriId($item['thr-parent-id'], $item['uid'], ['post-reason' => Item::PR_COMPLETION]); if (!$stored && ($item['thr-parent-id'] != $item['parent-uri-id'])) { $stored = Item::storeForUserByUriId($item['parent-uri-id'], $item['uid'], ['post-reason' => Item::PR_COMPLETION]); @@ -780,7 +780,7 @@ class Item } } - if (!DBA::isResult($parent)) { + if (!DI::dba()->isResult($parent)) { DI::logger()->notice('item parent was not found - ignoring item', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]); return []; } @@ -802,13 +802,13 @@ class Item $params = ['order' => ['id' => false]]; $toplevel_parent = Post::selectFirst($fields, $condition, $params); - if (!DBA::isResult($toplevel_parent) && $item['origin']) { + if (!DI::dba()->isResult($toplevel_parent) && $item['origin']) { $stored = Item::storeForUserByUriId($item['parent-uri-id'], $item['uid'], ['post-reason' => Item::PR_COMPLETION]); DI::logger()->info('Stored parent item for user', ['uri-id' => $item['parent-uri-id'], 'uid' => $item['uid'], 'stored' => $stored]); $toplevel_parent = Post::selectFirst($fields, $condition, $params); } - if (!DBA::isResult($toplevel_parent)) { + if (!DI::dba()->isResult($toplevel_parent)) { DI::logger()->notice('item top level parent was not found - ignoring item', ['parent-uri-id' => $parent['parent-uri-id'], 'uid' => $parent['uid']]); return []; }