Skip to content

Commit

Permalink
Remove deprecated unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Dec 7, 2024
1 parent cb47652 commit abd0e4e
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions classes/db/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,6 @@ public function update(string $sql, array $params = [], bool $callHooks = true,
return DB::affectingStatement($sql, $params);
}

/**
* Insert a row in a table, replacing an existing row if necessary.
*
* @param $arrFields Associative array of colName => value
* @param $keyCols Array of column names that are keys
*
* @deprecated 3.4
*/
public function replace(string $table, array $arrFields, array $keyCols): void
{
$matchValues = array_filter($arrFields, fn ($key) => in_array($key, $keyCols), ARRAY_FILTER_USE_KEY);
$additionalValues = array_filter($arrFields, fn ($key) => !in_array($key, $keyCols), ARRAY_FILTER_USE_KEY);
DB::table($table)->updateOrInsert($matchValues, $additionalValues);
}

/**
* Return the last ID inserted in an autonumbered field.
*/
Expand All @@ -196,16 +181,6 @@ protected function getInsertId(): int
return DB::getPdo()->lastInsertId();
}

/**
* Return the last ID inserted in an autonumbered field.
*
* @deprecated 3.4
*/
public function _getInsertId(): int
{
return $this->getInsertId();
}

/**
* Return datetime formatted for DB insertion.
*
Expand Down Expand Up @@ -370,16 +345,6 @@ public function convertToDB(mixed $value, ?string &$type = null, bool $nullable
return $value;
}

/**
* Cast the given parameter to an int, or leave it null.
*
* @deprecated 3.4
*/
public function nullOrInt(mixed $value): ?int
{
return (empty($value) ? null : (int) $value);
}

/**
* Get a list of additional field names to store in this DAO.
* This can be used to extend the table with virtual "columns",
Expand Down Expand Up @@ -551,20 +516,6 @@ public function getDataObjectSettings(string $tableName, string $idFieldName, in
}
}

/**
* Get the direction specifier for sorting from a SORT_DIRECTION_... constant.
*
* @deprecated 3.4
*/
public function getDirectionMapping(int $direction): string
{
return match($direction) {
self::SORT_DIRECTION_ASC => 'ASC',
self::SORT_DIRECTION_DESC => 'DESC',
default => 'ASC'
};
}

/**
* Generate a JSON message with an event that can be sent
* to the client to refresh itself according to changes
Expand Down

0 comments on commit abd0e4e

Please sign in to comment.