Add encryption handling to updateRowById method

Extended the updateRowById method across mysql, pdo, and IDb to support encrypted fields. Updated the PDO update logic to conditionally encrypt data using DES_ENCRYPT when specified. This ensures sensitive data is managed securely during updates.
This commit is contained in:
Stephan Kasdorf
2024-10-25 13:59:41 +02:00
parent f1ebcef60f
commit a68a1970c8
3 changed files with 23 additions and 8 deletions

View File

@@ -75,11 +75,12 @@ abstract class Db implements IDb
* @desc will update the a row with the $rowset parameter by the given id
* @param array $rowData
* @param int $id
* @param string $encrypted
* @return bool
*/
public function updateRowById(array $rowData, int $id): bool
public function updateRowById(array $rowData, int $id, string $encrypted = ""): bool
{
return Pdo::updateRowById( self::getTable()['table'], self::getTable()['fields'], $rowData, $id );
return Pdo::updateRowById( self::getTable()['table'], self::getTable()['fields'], $rowData, $id, $encrypted );
}
/**