You are here

public function Gardener::save in Backup and migrate prune 7

Same name and namespace in other branches
  1. 7.2 class/Gardener.php \Gardener::save()

Persist the settings for this gardener

File

class/Gardener.php, line 100
Gardener class implementation file

Class

Gardener
Gardener class implementation

Code

public function save() {
  $record = array(
    'name' => $this
      ->getName(),
    'settings' => $this
      ->getSettings(),
    'created' => $this
      ->getCreated(),
    'destination_id' => $this
      ->getDestination()
      ->get_id(),
  );
  if ($this
    ->isNew()) {

    // Saving a newly created gardener
    drupal_write_record('backup_migrate_gardener', $record);
  }
  else {

    // This means updating the Gardener
    $record['gardener_id'] = $this
      ->getId();
    drupal_write_record('backup_migrate_gardener', $record, 'gardener_id');
  }
}