Replace getCustomerByIdOrCustomerNumber with getUserByCustomerNumber across services and remove deprecated method.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user