3 * OMVModulePoolAction.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 OMVModulePoolAction
{
25 const OMVModulePoolAction_TYPE_CREATE
= 0;
26 const OMVModulePoolAction_TYPE_ADD
= 1;
30 * @param type An OMVModulePoolAction.
34 public static function getAction($action) {
35 if ($action === self
::OMVModulePoolAction_TYPE_CREATE
) {
37 } else if ($action === self
::OMVModulePoolAction_TYPE_ADD
) {
40 throw new Exception("$action: Unknown OMVModulePoolType");
45 * Return OMVModulePoolAction as string.
46 * @param type An OMVModulePoolAction.
47 * @return type as string.
50 public static function toString($type) {
51 if ($type === self
::OMVModulePoolAction_TYPE_CREATE
) {
52 return 'OMVModulePoolAction_TYPE_CREATE';
53 } else if ($type === self
::OMVModulePoolAction_TYPE_ADD
) {
54 return 'OMVModulePoolAction_TYPE_ADD';
56 throw new Exception("$type: Unknown OMVModulePoolType");