if you put this in custom/clients/base/api/CustomModuleApi.php
<?phpif(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');require_once("clients/base/api/ModuleApi.php");class CustomModuleApi extends ModuleApi
{
public function registerApiRest()
{
return parent::registerApiRest();
} public function retrieveRecord(ServiceBase $api, array $args)
{
$result = parent::retrieveRecord($api, $args); //append the current timestamp
return $result . ' ' . time();
}
}
it is supposed to intercept the GET method for any module with an id request, although it does not.The ping module seems to work though. If you put this in custom/clients/base/api/CustomPingApi.php
<?phpif(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');require_once("clients/base/api/PingApi.php");class CustomPingApi extends PingApi
{
public function registerApiRest()
{
//in case we want to add additional endpoints
return parent::registerApiRest();
} //override to modify the ping function of the ping endpoint
public function ping($api, $args)
{
$result = parent::ping($api, $args); //append the current timestamp
return $result . ' ' . time();
}
}
it works perfectly... can anyone tell me why the ping works and the module does not? Am I missing something?