check if method exists
This commit is contained in:
parent
f9e7a8dbb4
commit
92491e22ec
@ -284,7 +284,11 @@ switch ($action) {
|
|||||||
if ($_app_stage != 'demo') {
|
if ($_app_stage != 'demo') {
|
||||||
if (file_exists($dvc)) {
|
if (file_exists($dvc)) {
|
||||||
require_once $dvc;
|
require_once $dvc;
|
||||||
(new $p['device'])->sync_customer($c, $p);
|
if (method_exists($dvc, 'sync_customer')) {
|
||||||
|
(new $p['device'])->sync_customer($c, $p);
|
||||||
|
}else{
|
||||||
|
(new $p['device'])->add_customer($c, $p);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
new Exception(Lang::T("Devices Not Found"));
|
new Exception(Lang::T("Devices Not Found"));
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,11 @@ if (isset($_GET['sync']) && !empty($_GET['sync'])) {
|
|||||||
if ($_app_stage != 'demo') {
|
if ($_app_stage != 'demo') {
|
||||||
if (file_exists($dvc)) {
|
if (file_exists($dvc)) {
|
||||||
require_once $dvc;
|
require_once $dvc;
|
||||||
(new $p['device'])->sync_customer($c, $p);
|
if (method_exists($dvc, 'sync_customer')) {
|
||||||
|
(new $p['device'])->sync_customer($c, $p);
|
||||||
|
}else{
|
||||||
|
(new $p['device'])->add_customer($c, $p);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
new Exception(Lang::T("Devices Not Found"));
|
new Exception(Lang::T("Devices Not Found"));
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,11 @@ switch ($action) {
|
|||||||
if ($_app_stage != 'demo') {
|
if ($_app_stage != 'demo') {
|
||||||
if (file_exists($dvc)) {
|
if (file_exists($dvc)) {
|
||||||
require_once $dvc;
|
require_once $dvc;
|
||||||
(new $p['device'])->sync_customer($c, $p);
|
if (method_exists($dvc, 'sync_customer')) {
|
||||||
|
(new $p['device'])->sync_customer($c, $p);
|
||||||
|
}else{
|
||||||
|
(new $p['device'])->add_customer($c, $p);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
new Exception(Lang::T("Devices Not Found"));
|
new Exception(Lang::T("Devices Not Found"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user