public function loadById($id)
{
$data = $this->db->GetRow('SELECT * FROM farm_role_storage_config WHERE id = ? AND farm_role_id = ? LIMIT 1', array($id, $this->farmRole->ID));
if (empty($data)) {
return false;
}
$this->id = $data['id'];
$this->type = $data['type'];
$this->index = $data['index'];
$this->fs = $data['fs'];
$this->reUse = $data['re_use'];
$this->mount = $data['mount'];
$this->mountPoint = $data['mountpoint'];
$this->label = $data['label'];
$this->mountOptions = $data['mount_options'];
$this->rebuild = $data['rebuild'];
$this->status = $data['status'];
$this->settings = array();
foreach ($this->db->GetAll('SELECT name, value FROM farm_role_storage_settings WHERE storage_config_id = ?', array($this->id)) as $value) {
$this->settings[$value['name']] = $value['value'];
}
return $this;
}