X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/63617ac219787335b77eb40d276b41546420c763..42856e8b3cb0b621218f11d7828a51d03d77ae33:/src/Vdev.php diff --git a/src/Vdev.php b/src/Vdev.php index d6c0047..a5f8f9c 100644 --- a/src/Vdev.php +++ b/src/Vdev.php @@ -29,7 +29,7 @@ class OMVModuleZFSVdev { private $pool; /** - * Array holding disks + * This vdev type * * @var OMVModuleZFSVdevType $type Vdev type * @access private @@ -42,9 +42,10 @@ class OMVModuleZFSVdev { * Constructor * * @param $pool pool this mirror belongs to + * @throws OMVModuleZFSException */ - public function __construct($pool, OMVModuleZFSVdevType $type, array $disks) { + public function __construct($pool, $type, array $disks) { switch ($type) { case OMVModuleZFSVdevType::OMVMODULEZFSPLAIN: break; @@ -64,6 +65,8 @@ class OMVModuleZFSVdev { if (count($disks) < 5) throw new OMVModuleZFSException("A Raidz3 must contain at least 5 disks"); break; + default: + throw new OMVModuleZFSException("$type: Unknown zpool type"); } $this->pool = $pool; $this->disks = $disks; @@ -185,7 +188,17 @@ class OMVModuleZFSVdev { * @access public */ public function getPool() { - return $pool; + return $this->pool; + } + + /** + * Get type + * + * @return OMVModuleZFSVdevType + * @access public + */ + public function getType() { + return $this->type; } }