You are here

public function SmartlingApiWrapper::createFirebaseRecord in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 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\Smartling

Code

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;
}