Problem updating record by ID using PHP SDK

Problem updating record by ID using PHP SDK

I'm integrating the ZohoCRM PHP SDK with our Laravel app ( https://github.com/zoho/zcrm-php-sdk) but I'm having trouble performing a simple update on a record.

I'm using this code to retrieve the record, and update it -

$record = \ZCRMRecord::getInstance('Products', $entityId);
$data = $record->getData();
if (count($data) > 0) {
       $record->setFieldValue('Product_Name', 'Test Update');
       $response = $record->update();
}

However, $data is always an empty array.

I have retrieved the $entityId variable by fetching records from the 'Products' module and storing the value from the $record->getEntityId() method.

I'm not sure if my method of fetching the record to update is incorrect or if my method of retrieving the record ID is incorrect.

Kind regards,

Phil