| 1 |
<?php |
| 2 |
/** |
| 3 |
* ConfigParameterFactory.php |
| 4 |
* |
| 5 |
* The ConfigParameterFactory class file. |
| 6 |
* |
| 7 |
* PHP versions 5 |
| 8 |
* |
| 9 |
* @author Alexander Schneider <alexanderschneider85@gmail.com> |
| 10 |
* @copyright 2008-2017 Alexander Schneider |
| 11 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 12 |
* @version SVN: $id$ |
| 13 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 14 |
*/ |
| 15 |
namespace UserAccessManager\Config; |
| 16 |
|
| 17 |
/** |
| 18 |
* Class ConfigParameterFactory |
| 19 |
* |
| 20 |
* @package UserAccessManager\Config |
| 21 |
*/ |
| 22 |
class ConfigParameterFactory |
| 23 |
{ |
| 24 |
/** |
| 25 |
* Creates a boolean config parameter object. |
| 26 |
* |
| 27 |
* @param string $id |
| 28 |
* @param mixed $defaultValue |
| 29 |
* |
| 30 |
* @return BooleanConfigParameter |
| 31 |
*/ |
| 32 |
public function createBooleanConfigParameter($id, $defaultValue = false) |
| 33 |
{ |
| 34 |
return new BooleanConfigParameter($id, $defaultValue); |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Creates a selection config parameter object. |
| 39 |
* |
| 40 |
* @param string $id |
| 41 |
* @param mixed $defaultValue |
| 42 |
* @param array $selection |
| 43 |
* |
| 44 |
* @return SelectionConfigParameter |
| 45 |
*/ |
| 46 |
public function createSelectionConfigParameter($id, $defaultValue, array $selection) |
| 47 |
{ |
| 48 |
return new SelectionConfigParameter($id, $defaultValue, $selection); |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* Creates a string config parameter object. |
| 53 |
* |
| 54 |
* @param string $id |
| 55 |
* @param mixed $defaultValue |
| 56 |
* |
| 57 |
* @return StringConfigParameter |
| 58 |
*/ |
| 59 |
public function createStringConfigParameter($id, $defaultValue = '') |
| 60 |
{ |
| 61 |
return new StringConfigParameter($id, $defaultValue); |
| 62 |
} |
| 63 |
} |
| 64 |
|