protected function getImageVariations(array $siteList, $groupName)
    {
        $result = [];
        $allSame = true;
        $previousSA = null;
        foreach ($siteList as $siteaccess) {
            $result[$siteaccess] = $this->getImageVariationsForSiteaccess($siteaccess);
            if ($allSame && $previousSA !== null) {
                $allSame = ($result[$previousSA] === $result[$siteaccess]);
            }
            $previousSA = $siteaccess;
        }
        if ($allSame) {
            return [$groupName => $result[$previousSA]];
        }

        return $result;
    }
protected function getImageVariations(array $siteList, $groupName)
    {
        $result = [];
        $allSame = true;
        $previousSA = null;
        foreach ($siteList as $siteaccess) {
            $result[$siteaccess] = $this->getImageVariationsForSiteaccess($siteaccess);
            if ($allSame && $previousSA !== null) {
                $allSame = ($result[$previousSA] === $result[$siteaccess]);
            }
            $previousSA = $siteaccess;
        }
        if ($allSame) {
            return [$groupName => $result[$previousSA]];
        }

        return $result;
    }
protected function getImageVariations ( array $ siteList , $ groupName ) { $ result = [ ] ; $ allSame = true ; $ previousSA = null ; foreach ( $ siteList as $ siteaccess ) { $ result [ $ siteaccess ] = $ this -> getImageVariationsForSiteaccess ( $ siteaccess ) ; if ( $ allSame && $ previousSA !== null ) { $ allSame = ( $ result [ $ previousSA ] === $ result [ $ siteaccess ] ) ; } $ previousSA = $ siteaccess ; } if ( $ allSame ) { return [ $ groupName => $ result [ $ previousSA ] ] ; } return $ result ; }
Returns the image variations settings for all siteaccess unless it's the
same for each one, in this case, it returns the variations settings for
the group. This avoids to duplicate the image variations settings.

@param array $siteList
@param string $groupName

@return array
Returns the image variations settings for all siteaccess unless it s the same for each one in this case it returns the variations settings for the group . This avoids to duplicate the image variations settings .