public function SlickBase::save in Slick Carousel 7.3
Saves the optionset to database.
Return value
mixed Returns the newly saved or updated object, FALSE otherwise.
File
- src/
Entity/ SlickBase.php, line 136
Class
- SlickBase
- Defines the Slick configuration entity.
Namespace
Drupal\slick\EntityCode
public function save() {
$data = $this
->toArray();
$update = self::exists($data['name']) ? [
'name',
] : [];
$defaults['settings'] = self::defaultSettings();
$data['options'] = $data['options'] + $defaults;
return drupal_write_record(static::TABLE, $data, $update);
}