LdapTools\AttributeConverter\ConvertGroupType::modifyBitmaskValue PHP Method

modifyBitmaskValue() protected method

Modify the existing value based on the attributes bit.
protected modifyBitmaskValue ( integer $value, boolean $toggle, string $attribute ) : integer
$value integer
$toggle boolean
$attribute string
return integer
    protected function modifyBitmaskValue($value, $toggle, $attribute)
    {
        $bit = $this->getBitForAttribute($attribute);
        if ($toggle) {
            $value = (int) $value + (int) $bit;
        } else {
            $value = (int) $value - (int) $bit;
        }
        return $value;
    }