protected function modifyFlagValue($value)
    {
        $this->setDefaultLastValue($this->getEnumAttribute(), $this->getDefaultEnumValue());
        $flags = $this->getFlagFromLastValue($this->getLastValue());

        $value = $this->options['invert'] ? !$value : $value;
        if ($value) {
            $flags->add($this->flagName);
        } else {
            $flags->remove($this->flagName);
        }

        return $flags->getValue();
    }