protected function StringDatabaseStorage::dbStringDefaults

Sets default values from storage.

Parameters

Drupal\locale\StringInterface $string: The string object.

string $table: (optional) The table name.

1 call to StringDatabaseStorage::dbStringDefaults()
StringDatabaseStorage::dbStringInsert in drupal/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
Createds a database record for a string object.

File

drupal/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php, line 338
Definition of Drupal\locale\StringDatabaseStorage.

Class

StringDatabaseStorage
Defines the locale string class.

Namespace

Drupal\locale

Code

protected function dbStringDefaults($string, $table = NULL) {
  $table = $table ? $table : $this
    ->dbStringTable($string);
  if ($table && ($schema = drupal_get_schema($table))) {
    $values = array();
    foreach ($schema['fields'] as $name => $info) {
      if (isset($info['default'])) {
        $values[$name] = $info['default'];
      }
    }
    $string
      ->setValues($values, FALSE);
  }
}