You are here

function backup_migrate_profile::get_destinations in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/profiles.inc \backup_migrate_profile::get_destinations()
  2. 7.3 includes/profiles.inc \backup_migrate_profile::get_destinations()

Get the destination of the profile.

2 calls to backup_migrate_profile::get_destinations()
backup_migrate_profile::get_destination in includes/profiles.inc
Get the destination of the profile.
backup_migrate_profile::get_destination_name in includes/profiles.inc
Get the name of the destination.

File

includes/profiles.inc, line 301

Class

backup_migrate_profile
A profile class for crud operations.

Code

function get_destinations() {
  backup_migrate_include('destinations');
  if (empty($this->destinations)) {
    $this->destinations = array();
    $ids = $weights = array();
    if (!empty($this->destination_id)) {
      foreach ((array) $this->destination_id as $destination_id) {
        if (!in_array($destination_id, $ids) && ($destination = backup_migrate_get_destination($destination_id))) {
          $this->destinations[] = $destination;
          $weights[] = $destination
            ->get('weight');
          $ids[] = $destination_id;
        }
      }
    }

    // Sort the destinations by weight.
    array_multisort($weights, SORT_NUMERIC, $this->destinations);
  }
  return $this->destinations;
}