3 * OMVPoolModuleType.php
5 * Copyright 2013 Michael Rasmussen <mir@datanom.net>
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.
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.
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,
24 * @class OMVModulePoolType.
26 class OMVModulePoolType
{
27 const OMVModulePoolType_TYPE_NONE
= 0;
28 const OMVModulePoolType_TYPE_MIRROR
= 1;
29 const OMVModulePoolType_TYPE_RAIDZ1
= 2;
30 const OMVModulePoolType_TYPE_RAIDZ2
= 3;
31 const OMVModulePoolType_TYPE_RAIDZ3
= 4;
34 * Return OMVModulePoolType as string.
35 * @param type An OMVModulePoolType.
36 * @return type as string.
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';
51 throw new Exception("$type: Unknown OMVModulePoolType");