You are here

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

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

Get the destination for the gardener

Return value

The destination object associated with this gardener

2 calls to Gardener::getDestination()
Gardener::processPrune in class/Gardener.php
Tests if the file is elegible to be prunned and deletes it if necessary
Gardener::prune in class/Gardener.php
Delete the files that match the criteria
1 method overrides Gardener::getDestination()
GardenerFake::getDestination in ./backup_migrate_prune.test
Overwrites getDestination to return a fake destination

File

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

Class

Gardener
Gardener class implementation

Code

public function getDestination() {

  // Get cached settings
  if (empty($this->destination)) {

    // Load the record from the database
    $destination_id = db_select('backup_migrate_gardener', 'bmg')
      ->fields('bmg', array(
      'destination_id',
    ))
      ->condition('bmg.gardener_id', $this
      ->getId())
      ->execute()
      ->fetchField();
    if (isset($destination_id) && is_numeric($destination_id)) {
      $this
        ->setDestination(backup_migrate_get_destination($destination_id));
    }
  }
  return $this->destination;
}