public function SmartlingApiWrapper::createFirebaseRecord in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.3 src/Smartling/SmartlingApiWrapper.php \Drupal\tmgmt_smartling\Smartling\SmartlingApiWrapper::createFirebaseRecord()
Parameters
$spaceId:
$objectId:
$ttl:
$data:
Return value
null
File
- src/
Smartling/ SmartlingApiWrapper.php, line 321 - SmartlingApiWrapper.php.
Class
- SmartlingApiWrapper
- Class SmartlingApiWrapper @package Drupal\tmgmt_smartling\Smartling
Namespace
Drupal\tmgmt_smartling\SmartlingCode
public function createFirebaseRecord($spaceId, $objectId, $ttl, $data) {
$result = NULL;
try {
$params = new RecordParameters();
$params
->setTtl($ttl);
$params
->setData($data);
$this
->getApi('progress')
->createRecord($spaceId, $objectId, $params);
$result = TRUE;
} catch (SmartlingApiException $e) {
$this->logger
->error('Smartling failed to create a record:<br/>Error: @error', [
'@error' => $e
->getMessage(),
]);
}
return $result;
}