LdapTools\AttributeConverter\ConvertGroupType::modifyGroupScopeBit PHP Method

modifyGroupScopeBit() protected method

Based on the current value, remove the bit for the scope that is already set before adding the new one (if the value is set to true for the scope to be active anyway).
protected modifyGroupScopeBit ( integer $lastValue, boolean $value )
$lastValue integer
$value boolean
    protected function modifyGroupScopeBit($lastValue, $value)
    {
        if ($value) {
            foreach ($this->getOptions()['types']['scope'] as $attribute) {
                if (MBString::strtolower($attribute) == MBString::strtolower($this->getAttribute())) {
                    continue;
                }
                if ((int) $lastValue & (int) $this->getOptions()['typeMap'][$attribute]) {
                    $lastValue = $this->modifyBitmaskValue($lastValue, false, $attribute);
                }
            }
        }
        $lastValue = $this->modifyBitmaskValue($lastValue, $value, $this->getAttribute());
        $this->setLastValue($lastValue);
    }