You are here

public function SmartDateFormat::setOptions in Smart Date 3.4.x

Same name and namespace in other branches
  1. 8.2 src/Entity/SmartDateFormat.php \Drupal\smart_date\Entity\SmartDateFormat::setOptions()
  2. 8 src/Entity/SmartDateFormat.php \Drupal\smart_date\Entity\SmartDateFormat::setOptions()
  3. 3.x src/Entity/SmartDateFormat.php \Drupal\smart_date\Entity\SmartDateFormat::setOptions()
  4. 3.0.x src/Entity/SmartDateFormat.php \Drupal\smart_date\Entity\SmartDateFormat::setOptions()
  5. 3.1.x src/Entity/SmartDateFormat.php \Drupal\smart_date\Entity\SmartDateFormat::setOptions()
  6. 3.2.x src/Entity/SmartDateFormat.php \Drupal\smart_date\Entity\SmartDateFormat::setOptions()
  7. 3.3.x src/Entity/SmartDateFormat.php \Drupal\smart_date\Entity\SmartDateFormat::setOptions()

Sets the array of options for this format.

Parameters

array $options: The array of options to use for this format.

Return value

$this

Overrides SmartDateFormatInterface::setOptions

File

src/Entity/SmartDateFormat.php, line 285

Class

SmartDateFormat
Defines the Smart date format entity.

Namespace

Drupal\smart_date\Entity

Code

public function setOptions(array $values) {
  $keys = $this
    ->getAllKeys();
  foreach ($keys as $key) {
    if (isset($values[$key])) {
      $this
        ->set($key, $values[$key]);
    }
  }
  return $values;
}