From c03e412f97676566404534e126c000585743e5aa Mon Sep 17 00:00:00 2001 From: Niclas Berglind Date: Tue, 4 Mar 2014 19:44:18 +0100 Subject: [PATCH] Added inherit method to Dataset Signed-off-by: Niclas Berglind --- src/Dataset.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Dataset.php b/src/Dataset.php index 673d011..2ba1bed 100644 --- a/src/Dataset.php +++ b/src/Dataset.php @@ -121,6 +121,7 @@ class OMVModuleZFSDataset { /** * Get all Dataset properties from commandline and update object properties attribute * + * @return void * @throws OMVModuleZFSException * @access private */ @@ -141,6 +142,7 @@ class OMVModuleZFSDataset { * Get single Datset property from commandline and update object property attribute * * @param string $property Name of the property to update + * @return void * @throws OMVModuleZFSException * @access private */ @@ -157,6 +159,7 @@ class OMVModuleZFSDataset { /** * Destroy the Dataset. * + * @return void * @throws OMVModuleZFSException * @access public */ @@ -172,6 +175,7 @@ class OMVModuleZFSDataset { * Renames a Dataset * * @param string $newname New name of the Dataset + * @return void * @throws OMVModuleZFSException * @access public */ @@ -184,6 +188,24 @@ class OMVModuleZFSDataset { $this->name = $newname; } + /** + * Clears a previously set proporty and specifies that it should be + * inherited from it's parent. + * + * @param string $property Name of the property to inherit. + * @return void + * @throws OMVModuleZFSException + * @access public + */ + public function inherit($property) { + $cmd = "zfs inherit " . $property . " " . $this->name . " 2>&1"; + OMVUtil::exec($cmd,$out,$res); + if ($res) { + throw new OMVModuleZFSException(implode("\n", $out)); + } + $this->updateProperty($property); + } + } ?> -- 2.39.2