public function loadSwatchType($entityTypeId, $attributeCode)
    {

        // prepare a unique key for the swatch type from the given code and entity type ID
        $key = sprintf('%d-%s', $entityTypeId, $attributeCode);

        // query whether or not a swatch type has been set
        if ($this->hasSwatchType($key) === false) {
            // load the attribute and the catalog attribute data
            $attribute = $this->loadAttributeByEntityTypeIdAndAttributeCode($entityTypeId, $attributeCode);
            $catalogAttribute = $this->loadCatalogAttribute($attribute[MemberNames::ATTRIBUTE_ID]);

            // query whether or not additional data is available (to figure out if the attribute is a swatch type or not)
            if (is_array($catalogAttribute[MemberNames::ADDITIONAL_DATA]) && $catalogAttribute[MemberNames::ADDITIONAL_DATA] !== null) {
                // unserialize the additional data
                $additionalData = json_decode($catalogAttribute[MemberNames::ADDITIONAL_DATA]);
                // load and return the swatch type (can be either one of 'text' or 'visual')
                return $this->setSwatchType($key, $additionalData[CatalogAttributeObserver::SWATCH_INPUT_TYPE]);
            }
        }

        // return the actual swatch type
        return $this->getSwatchType($key);
    }