public function Gardener::getCoworkers in Backup and migrate prune 7
Same name and namespace in other branches
- 7.2 class/Gardener.php \Gardener::getCoworkers()
Get all gardeners associated with the destination of the current gardener
Parameters
$exclude: Exclude the current gardener
File
- class/
Gardener.php, line 314 - Gardener class implementation file
Class
- Gardener
- Gardener class implementation
Code
public function getCoworkers($exclude = FALSE) {
$destination_id = $this->destination
->get_id();
$results = db_select('backup_migrate_gardener', 'bmg')
->fields('bmg', array(
'gardener_id',
))
->condition('bmg.destination_id', $destination_id)
->execute();
foreach ($results as $result) {
if (!$exclude || $result->gardener_id != $this
->getId()) {
$coworkers[$result->gardener_id] = new Gardener($result->gardener_id);
}
}
return $coworkers;
}