protected function labelFromMode($mode)
    {
        if ($mode instanceof IdProperty) {
            $mode = $mode->mode();
        }

        switch ($mode) {
            case IdProperty::MODE_AUTO_INCREMENT:
                return 'auto-increment';

            case IdProperty::MODE_UNIQID:
                return 'uniqid()';

            case IdProperty::MODE_UUID:
                return 'RFC-4122 UUID';

            case IdProperty::MODE_CUSTOM:
                return 'custom';
        }

        throw new UnexpectedValueException(sprintf(
            'The ID mode was not recognized: %s',
            is_object($mode) ? get_class($mode) : gettype($mode)
        ));
    }