static public function isSaleSupportsDocumentType(SaleInterface $sale, $type)
    {
        if (!DocumentTypes::isValidType($type)) {
            return false;
        }

        if (empty($classes = DocumentTypes::getClasses($type))) {
            return false;
        }

        foreach ($classes as $class) {
            if (is_subclass_of($sale, $class)) {
                return true;
            }
        }

        return false;
    }