blob: 8712ef755e7b2ebf1653da34c657bd20077e920c [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace LdapRecord\Models;
4
5trait 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}