src/ShopBundle/objects/db/TShopArticle.class.php
public function HasVariants($bCheckForActiveVariantsOnly = false)
    {
        if ($this->IsVariant()) {
            return false;
        }
        $sInternalCacheKey = 'bHasVariants';
        if ($bCheckForActiveVariantsOnly) {
            $sInternalCacheKey .= 'OnlyActive';
        }
        $bHasVariants = &$this->GetFromInternalCache($sInternalCacheKey);
        if (is_null($bHasVariants)) {
            $bHasVariants = false;
            if (!empty($this->fieldShopVariantSetId)) {
                $oVariants = $this->GetFieldShopArticleVariantsList(array(), $bCheckForActiveVariantsOnly);
                $bHasVariants = (!is_null($oVariants) && $oVariants->Length() > 0);
            }
            $this->SetInternalCache($sInternalCacheKey, $bHasVariants);
        }

        return $bHasVariants;
    }
public function HasVariants($bCheckForActiveVariantsOnly = false)
    {
        if ($this->IsVariant()) {
            return false;
        }
        $sInternalCacheKey = 'bHasVariants';
        if ($bCheckForActiveVariantsOnly) {
            $sInternalCacheKey .= 'OnlyActive';
        }
        $bHasVariants = &$this->GetFromInternalCache($sInternalCacheKey);
        if (is_null($bHasVariants)) {
            $bHasVariants = false;
            if (!empty($this->fieldShopVariantSetId)) {
                $oVariants = $this->GetFieldShopArticleVariantsList(array(), $bCheckForActiveVariantsOnly);
                $bHasVariants = (!is_null($oVariants) && $oVariants->Length() > 0);
            }
            $this->SetInternalCache($sInternalCacheKey, $bHasVariants);
        }

        return $bHasVariants;
    }
public function HasVariants ( $ bCheckForActiveVariantsOnly = false ) { if ( $ this -> IsVariant ( ) ) { return false ; } $ sInternalCacheKey = 'bHasVariants' ; if ( $ bCheckForActiveVariantsOnly ) { $ sInternalCacheKey .= 'OnlyActive' ; } $ bHasVariants = & $ this -> GetFromInternalCache ( $ sInternalCacheKey ) ; if ( is_null ( $ bHasVariants ) ) { $ bHasVariants = false ; if ( ! empty ( $ this -> fieldShopVariantSetId ) ) { $ oVariants = $ this -> GetFieldShopArticleVariantsList ( array ( ) , $ bCheckForActiveVariantsOnly ) ; $ bHasVariants = ( ! is_null ( $ oVariants ) && $ oVariants -> Length ( ) > 0 ) ; } $ this -> SetInternalCache ( $ sInternalCacheKey , $ bHasVariants ) ; } return $ bHasVariants ; }
return true if the article has variants.

@param bool $bCheckForActiveVariantsOnly

@return bool
return true if the article has variants .