]>
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 MR |
27 | const OMVModulePoolType_TYPE_NONE = 0; |
28 | const OMVModulePoolType_TYPE_STRIPE = 1; | |
29 | const OMVModulePoolType_TYPE_MIRROR = 2; | |
30 | const OMVModulePoolType_TYPE_RAIDZ1 = 3; | |
31 | const OMVModulePoolType_TYPE_RAIDZ2 = 4; | |
32 | const OMVModulePoolType_TYPE_RAIDZ3 = 5; | |
76e64919 MR |
33 | |
34 | /** | |
35 | * Return OMVModulePoolType as string. | |
36 | * @param type An OMVModulePoolType. | |
37 | * @return type as string. | |
38 | * @throws Exception. | |
39 | */ | |
40 | public static function toString($type) { | |
41 | if ($type === self::OMVModulePoolType_TYPE_NONE) { | |
42 | return 'OMVModulePoolType_TYPE_NONE'; | |
e4ad4a7d MR |
43 | } else if ($type === self::OMVModulePoolType_TYPE_STRIPE) { |
44 | return 'OMVModulePoolType_TYPE_STRIPE'; | |
76e64919 MR |
45 | } else if ($type === self::OMVModulePoolType_TYPE_MIRROR) { |
46 | return 'OMVModulePoolType_TYPE_MIRROR'; | |
47 | } else if ($type === self::OMVModulePoolType_TYPE_RAIDZ1) { | |
48 | return 'OMVModulePoolType_TYPE_RAIDZ1'; | |
49 | } else if ($type === self::OMVModulePoolType_TYPE_RAIDZ2) { | |
50 | return 'OMVModulePoolType_TYPE_RAIDZ2'; | |
51 | } else if ($type === self::OMVModulePoolType_TYPE_RAIDZ3) { | |
52 | return 'OMVModulePoolType_TYPE_RAIDZ3'; | |
53 | } else { | |
54 | throw new Exception("$type: Unknown OMVModulePoolType"); | |
55 | } | |
56 | } | |
57 | } |