diff --git a/clients/WPCrm.php b/clients/WPCrm.php index 883432c..4c64528 100644 --- a/clients/WPCrm.php +++ b/clients/WPCrm.php @@ -251,6 +251,34 @@ class WPCrm extends ApiV1 } } + /** + * Get a customer from table + * + * @param int $crm_id The customer crm id + * + * @return object|null + */ + public static function getUserFromTable($crm_id) + { + return self::_getWpDB()->get_row( + 'SELECT * FROM `ldc_wp_customers` WHERE `crm_id` = ' . $crm_id + ); + } + + /** + * Get a customer from table by an email + * + * @param int $email The customer email + * + * @return object|null + */ + public static function getUserFromTableByEmail($email) + { + return self::_getWpDB()->get_row( + 'SELECT * FROM `ldc_wp_customers` WHERE `email` = "' . $email . '"' + ); + } + /** * Get a customer from table *