42bb1607ce78661569b4af7a4266f16daf1150a6
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\option\user\group;
3
4 /**
5 * InfiniteInverseIntegerUserGroupOptionType is an implementation of IUserGroupOptionType
6 * for integer values.
7 * The merge of option values returns -1 if all values are -1 otherwise the lowest value.
8 *
9 * @author Marcel Werk
10 * @copyright 2001-2012 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package com.woltlab.wcf
13 * @subpackage system.option.user.group
14 * @category Community Framework
15 */
16 class InfiniteInverseIntegerUserGroupOptionType extends InverseIntegerUserGroupOptionType {
17 /**
18 * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
19 */
20 public function merge($defaultValue, $groupValue) {
21 if (($defaultValue == -1 && $groupValue == -1) || ($defaultValue == $groupValue)) {
22 return null;
23 }
24
25 return min($defaultValue, $groupValue);
26 }
27 }