+ public function setFeatures($features) {
+ foreach ($features as $newfeature) {
+ $cmd = "zfs set " . $newfeature . " " . $this->name;
+ OMVUtil::exec($cmd,$out,$res);
+ if ($res == 1) {
+ throw new OMVModuleZFSException(implode("\n", $out));
+ }
+ $tmp = explode("=", $newfeature);
+ $newfeaturek = $tmp[0];
+ $found = false;
+ for ($i=0; $i<count($this->features); $i++) {
+ $tmp = explode("=", $this->features[$i]);
+ $oldfeaturek = $tmp[0];
+ if (strcmp($newfeaturek, $oldfeaturek) == 0) {
+ $this->features[$i] = $newfeature;
+ $found = true;
+ continue;
+ }
+ }
+ if (!$found) {
+ array_push($this->features, $newfeature);
+ }
+ }
+ }
+
+ /**
+ * Destroy the Dataset.
+ *
+ */
+ public function destroy() {
+ $cmd = "zfs destroy " . $this->name;
+ OMVUtil::exec($cmd,$out,$res);
+ if ($res == 1) {
+ throw new OMVModuleZFSException(implode("\n", $out));
+ }