]>
Commit | Line | Data |
---|---|---|
76e64919 MR |
1 | <?php |
2 | /* | |
3 | * OMVPoolModuleType.php | |
4 | * | |
5 | * Copyright 2013 Michael Rasmussen <mir@datanom.net> | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
20 | * MA 02110-1301, USA. | |
21 | */ | |
22 | ||
23 | /** | |
24 | * @class OMVModulePoolType. | |
25 | */ | |
26 | class OMVModulePoolType { | |
e4ad4a7d | 27 | const OMVModulePoolType_TYPE_NONE = 0; |
c6268644 MR |
28 | const OMVModulePoolType_TYPE_MIRROR = 1; |
29 | const OMVModulePoolType_TYPE_RAIDZ1 = 2; | |
30 | const OMVModulePoolType_TYPE_RAIDZ2 = 3; | |
31 | const OMVModulePoolType_TYPE_RAIDZ3 = 4; | |
76e64919 MR |
32 | |
33 | /** | |
34 | * Return OMVModulePoolType as string. | |
35 | * @param type An OMVModulePoolType. | |
36 | * @return type as string. | |
37 | * @throws Exception. | |
38 | */ | |
39 | public static function toString($type) { | |
40 | if ($type === self::OMVModulePoolType_TYPE_NONE) { | |
41 | return 'OMVModulePoolType_TYPE_NONE'; | |
42 | } else if ($type === self::OMVModulePoolType_TYPE_MIRROR) { | |
43 | return 'OMVModulePoolType_TYPE_MIRROR'; | |
44 | } else if ($type === self::OMVModulePoolType_TYPE_RAIDZ1) { | |
45 | return 'OMVModulePoolType_TYPE_RAIDZ1'; | |
46 | } else if ($type === self::OMVModulePoolType_TYPE_RAIDZ2) { | |
47 | return 'OMVModulePoolType_TYPE_RAIDZ2'; | |
48 | } else if ($type === self::OMVModulePoolType_TYPE_RAIDZ3) { | |
49 | return 'OMVModulePoolType_TYPE_RAIDZ3'; | |
50 | } else { | |
51 | throw new Exception("$type: Unknown OMVModulePoolType"); | |
52 | } | |
53 | } | |
54 | } |