]> git.datanom.net - omvzfs.git/blobdiff - src/Vdev.php
Initial implementation of GUI for adding ZFS pools plus minor bugfixes.
[omvzfs.git] / src / Vdev.php
index b9183d84ba24a24061bf566c310d1dae4733564c..a5f8f9ce2b09cf4ef2a19ebc73b218fdd3515c9a 100644 (file)
@@ -29,7 +29,7 @@ class OMVModuleZFSVdev {
     private $pool;
 
     /**
     private $pool;
 
     /**
-     * Array holding disks
+     * This vdev type
      *
      * @var    OMVModuleZFSVdevType $type Vdev type
      * @access private
      *
      * @var    OMVModuleZFSVdevType $type Vdev type
      * @access private
@@ -45,7 +45,7 @@ class OMVModuleZFSVdev {
      * @throws OMVModuleZFSException
         */
 
      * @throws OMVModuleZFSException
         */
 
-       public function __construct($pool, OMVModuleZFSVdevType $type, array $disks) {
+       public function __construct($pool, $type, array $disks) {
                switch ($type) {
                        case OMVModuleZFSVdevType::OMVMODULEZFSPLAIN:
                                break;
                switch ($type) {
                        case OMVModuleZFSVdevType::OMVMODULEZFSPLAIN:
                                break;
@@ -65,6 +65,8 @@ class OMVModuleZFSVdev {
                                if (count($disks) < 5)
                                        throw new OMVModuleZFSException("A Raidz3 must contain at least 5 disks");
                                break;
                                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;
                }
                $this->pool = $pool;
                $this->disks = $disks;
@@ -186,7 +188,7 @@ class OMVModuleZFSVdev {
      * @access public
      */
     public function getPool() {
      * @access public
      */
     public function getPool() {
-        return $pool;
+        return $this->pool;
     }
 
     /**
     }
 
     /**
@@ -196,7 +198,7 @@ class OMVModuleZFSVdev {
      * @access public
      */
     public function getType() {
      * @access public
      */
     public function getType() {
-        return $type;
+        return $this->type;
     }
 
 }
     }
 
 }
This page took 0.030086 seconds and 5 git commands to generate.