Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace LdapRecord\Models; |
| 4 | |
| 5 | trait DetectsResetIntegers |
| 6 | { |
| 7 | /** |
| 8 | * Determine if the given value is an LDAP reset integer. |
| 9 | * |
| 10 | * The integer values '0' and '-1' can be used on certain |
| 11 | * LDAP attributes to instruct the server to reset the |
| 12 | * value to an 'unset' or 'cleared' state. |
| 13 | * |
| 14 | * @param mixed $value |
| 15 | * |
| 16 | * @return bool |
| 17 | */ |
| 18 | protected function valueIsResetInteger($value) |
| 19 | { |
| 20 | return in_array($value, [0, -1], $strict = true); |
| 21 | } |
| 22 | } |