]> git.datanom.net - omvzfs.git/blobdiff - src/Vdev.php
Some minor bug fixes
[omvzfs.git] / src / Vdev.php
index d6c0047fe87da15227ce156c23df4c931898f63e..2c5f9995a110f780e3779eb10472d0f43a47619e 100644 (file)
@@ -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;
@@ -188,6 +191,16 @@ class OMVModuleZFSVdev {
         return $pool;
     }
 
+    /**
+     * Get type
+     *
+     * @return OMVModuleZFSVdevType
+     * @access public
+     */
+    public function getType() {
+        return $type;
+    }
+
 }
 
 ?>
This page took 0.029944 seconds and 5 git commands to generate.