I have some functionality in namespace:
namespace LyteeAPI\Models\Order;
Now, I need to call SaveOrder() function, that resides in a controller in different namespace:
namespace Lytee\Library\Helpers\Backend
in controller Erp.
I need it to be a bit more dynamic, so I'm calling this controller like:
$erpApi = 'Lytee\Library\Helpers\Backend\\' . 'ErpApiClient';
if( \class_exists($erpApi))
{
$erpApiClient = new $erpApi($erpConfig);
$erpResult = $erpApiClient->saveOrder($this);
}
$erpApiClient gets constructed, if I var_dump it, it has proper properties and functions (via get_class_functions()).
If I call
$erpApiClient->saveOrder($this)
without parameter $this, I get php error about missing arguments for this function, which tells me, that php knows which function to call.
But I never seems to reach inside of this function. Whatever I do in this saveOrder() function, it doesn't get executed..
Logs don't show any errors if function call is correct..
What am I missing here?
saveOrder
what happens?