Skip to content

Commit

Permalink
Replace deprecated method getDbo() by getDatabase() (joomla#38023)
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation authored Jun 10, 2022
1 parent bb2e172 commit ca1d7e7
Show file tree
Hide file tree
Showing 106 changed files with 255 additions and 255 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ActionlogModel extends BaseDatabaseModel
public function addLog($messages, $messageLanguageKey, $context, $userId = null)
{
$user = Factory::getUser($userId);
$db = $this->getDbo();
$db = $this->getDatabase();
$date = Factory::getDate();
$params = ComponentHelper::getComponent('com_actionlogs')->getParams();

Expand Down Expand Up @@ -116,7 +116,7 @@ protected function sendNotificationEmails($messages, $username, $context)
{
$app = Factory::getApplication();
$lang = $app->getLanguage();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

$query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function populateState($ordering = 'a.id', $direction = 'desc')
*/
protected function getListQuery()
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('a.*')
->select($db->quoteName('u.name'))
Expand Down Expand Up @@ -243,7 +243,7 @@ private function buildDateRange($range)
public function getLogsForItem($extension, $itemId)
{
$itemId = (int) $itemId;
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('a.*')
->select($db->quoteName('u.name'))
Expand Down Expand Up @@ -279,7 +279,7 @@ public function getLogsForItem($extension, $itemId)
*/
public function getLogsData($pks = null)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $this->getLogDataQuery($pks);

$db->setQuery($query);
Expand All @@ -298,7 +298,7 @@ public function getLogsData($pks = null)
*/
public function getLogDataAsIterator($pks = null)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $this->getLogDataQuery($pks);

$db->setQuery($query);
Expand All @@ -317,7 +317,7 @@ public function getLogDataAsIterator($pks = null)
*/
private function getLogDataQuery($pks = null)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('a.*')
->select($db->quoteName('u.name'))
Expand Down Expand Up @@ -345,7 +345,7 @@ private function getLogDataQuery($pks = null)
public function delete(&$pks)
{
$keys = ArrayHelper::toInteger($pks);
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->delete($db->quoteName('#__action_logs'))
->whereIn($db->quoteName('id'), $keys);
Expand Down Expand Up @@ -378,7 +378,7 @@ public function purge()
{
try
{
$this->getDbo()->truncateTable('#__action_logs');
$this->getDatabase()->truncateTable('#__action_logs');
}
catch (Exception $e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function &getInfo(): array
return $this->info;
}

$db = $this->getDbo();
$db = $this->getDatabase();

$this->info = [
'php' => php_uname(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected function getListQuery()

// Create a new query object.
$user = Factory::getUser();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

$details = $type->get('details');
Expand Down Expand Up @@ -505,7 +505,7 @@ protected function getListQuery()
public function purge($context = '', $key = '')
{
$app = Factory::getApplication();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)->delete($db->quoteName('#__associations'));

// Filter by associations context.
Expand Down Expand Up @@ -556,7 +556,7 @@ public function purge($context = '', $key = '')
public function clean($context = '', $key = '')
{
$app = Factory::getApplication();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('key') . ', COUNT(*)')
->from($db->quoteName('#__associations'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ protected function prepareTable($table)
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('MAX(' . $db->quoteName('ordering') . ')')
->from($db->quoteName('#__banners'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function &getCategoryOrders()
{
if (!isset($this->cache['categoryorders']))
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select(
[
Expand All @@ -99,7 +99,7 @@ public function &getCategoryOrders()
*/
protected function getListQuery()
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

// Select the required fields from the table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected function getStoreId($id = '')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

$defaultPurchase = (int) ComponentHelper::getParams('com_banners')->get('purchase_type', 3);
Expand Down Expand Up @@ -232,7 +232,7 @@ public function getItems()
// Faster to do three queries for very large banner trees.

// Get the clients in the list.
$db = $this->getDbo();
$db = $this->getDatabase();
$clientIds = array_column($items, 'id');

$query = $db->getQuery(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function populateState($ordering = 'b.name', $direction = 'asc')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

// Select the required fields from the table.
Expand Down Expand Up @@ -206,7 +206,7 @@ public function delete()
if ($allow)
{
// Delete tracks from this banner
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->delete($db->quoteName('#__banner_tracks'));

Expand Down Expand Up @@ -381,7 +381,7 @@ protected function getCategoryName()

if ($categoryId)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__categories'))
Expand Down Expand Up @@ -419,7 +419,7 @@ protected function getClientName()

if ($clientId)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('name'))
->from($db->quoteName('#__banner_clients'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected function getStoreId($id = '')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$user = Factory::getUser();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public function save($data)
}

// Get associationskey for edited item
$db = $this->getDbo();
$db = $this->getDatabase();
$id = (int) $table->id;
$query = $db->getQuery(true)
->select($db->quoteName('key'))
Expand Down Expand Up @@ -879,7 +879,7 @@ protected function batchFlipordering($value, $pks, $contexts)
{
$successful = array();

$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

/**
Expand Down Expand Up @@ -937,7 +937,7 @@ protected function batchCopy($value, $pks, $contexts)
$parts = explode('.', $value);
$parentId = (int) ArrayHelper::getValue($parts, 0, 1);

$db = $this->getDbo();
$db = $this->getDatabase();
$extension = Factory::getApplication()->input->get('extension', '', 'word');
$newIds = array();

Expand Down Expand Up @@ -1164,7 +1164,7 @@ protected function batchMove($value, $pks, $contexts)
$type = new UCMType;
$this->type = $type->getTypeByAlias($this->typeAlias);

$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$extension = Factory::getApplication()->input->get('extension', '', 'word');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function populateState($ordering = 'table', $direction = 'asc')
*/
public function checkin($ids = array())
{
$db = $this->getDbo();
$db = $this->getDatabase();

if (!is_array($ids))
{
Expand Down Expand Up @@ -172,7 +172,7 @@ public function getItems()
{
if (!isset($this->items))
{
$db = $this->getDbo();
$db = $this->getDatabase();
$tables = $db->getTableList();
$prefix = Factory::getApplication()->get('dbprefix');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ protected function prepareTable($table)
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from($db->quoteName('#__contact_details'));
Expand Down Expand Up @@ -511,7 +511,7 @@ public function featured($pks, $value = 0)

try
{
$db = $this->getDbo();
$db = $this->getDatabase();

$query = $db->getQuery(true);
$query->update($db->quoteName('#__contact_details'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function getStoreId($id = '')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$user = Factory::getUser();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected function cleanupPostBatchCopy(TableInterface $table, $newId, $oldId)
// Check if the article was featured and update the #__content_frontpage table
if ($table->featured == 1)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select(
[
Expand Down Expand Up @@ -430,7 +430,7 @@ public function getItem($pk = null)
if ($item->featured)
{
// Get featured dates.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select(
[
Expand Down Expand Up @@ -941,7 +941,7 @@ public function featured($pks, $value = 0, $featuredUp = null, $featuredDown = n

try
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->update($db->quoteName('#__content'))
->set($db->quoteName('featured') . ' = :featured')
Expand Down Expand Up @@ -1186,7 +1186,7 @@ public function delete(&$pks)
if ($return)
{
// Now check to see if this articles was featured if so delete it from the #__content_frontpage table
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->delete($db->quoteName('#__content_frontpage'))
->whereIn($db->quoteName('content_id'), $pks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ protected function getStoreId($id = '')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$user = Factory::getUser();

Expand Down Expand Up @@ -600,7 +600,7 @@ public function getTransitions()
return $this->cache[$store];
}

$db = $this->getDbo();
$db = $this->getDatabase();
$user = Factory::getUser();

$items = $this->getItems();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function getListQuery()
{
$query = parent::getListQuery();

$query->select($this->getDbo()->quoteName('fp.ordering'));
$query->select($this->getDatabase()->quoteName('fp.ordering'));

return $query;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function getItems()
throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}

$nullDate = $this->getDbo()->getNullDate();
$nullDate = $this->getDatabase()->getNullDate();

foreach (array($table1, $table2) as $table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ protected function populateState($ordering = 'h.save_date', $direction = 'DESC')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$itemId = $this->getState('item_id');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function getItem($pk = null)
'publish_down',
);

$nullDate = $this->getDbo()->getNullDate();
$nullDate = $this->getDatabase()->getNullDate();

foreach ($dateProperties as $dateProperty)
{
Expand Down
Loading

0 comments on commit ca1d7e7

Please sign in to comment.