Replace getCustomerByIdOrCustomerNumber with getUserByCustomerNumber across services and remove deprecated method.

This commit is contained in:
Jeppe Bundgaard
2026-01-06 15:50:59 +01:00
parent 49589de98e
commit 0eddf69ae4
5 changed files with 12 additions and 27 deletions
-15
View File
@@ -134,21 +134,6 @@ class users_o extends db
return new $this->language_pack();
}
public function getCustomerByIdOrCustomerNumber(int $idOrCustomerNumber): users_o
{
global $db;
// Get the record from the database
$sql = "SELECT * FROM $this->table WHERE id = $idOrCustomerNumber OR customer_number = '$idOrCustomerNumber'";
$result = $db->query($sql);
if ($result->num_rows > 0) {
$this->id = $result->fetch_assoc()['id'];
$this->getObjectProperties();
} else {
// Import the customer
$this->importCustomerFromExternalSource($idOrCustomerNumber);
}
return $this;
}
private function importCustomerFromExternalSource(int $customer_number): object|bool
{