*/
public function isClone() {
$origin = $this->getProperty("origin");
- if (strlen($origin) > 0) {
+ if (strlen($origin["value"]) > 0) {
return true;
} else {
return false;
*/
public function getOrigin() {
if ($this->isClone()) {
- return $this->getProperty("origin");
+ $origin = $this->getProperty("origin");
+ return $origin['value'];
} else {
return "";
}
}
+ /**
+ * Promotes the Dataset if it's a clone.
+ *
+ * @return void
+ * @access public
+ */
+ public function promote() {
+ if ($this->isClone()) {
+ $cmd = "zfs promote " . $this->name . " 2>&1";
+ $this->exec($cmd,$out,$res);
+ }
+ }
+
/**
* Helper function to execute a command and throw an exception on error
* (requires stderr redirected to stdout for proper exception message).