Check if the current customer is in the asked group

@param string $groupCode Code for the group to check

@return boolean

@uses getGroupCode()
198056
public function checkGroup($groupCode)
    {
        /** @var SecurityContext $securityContext */
        $securityContext = $this->container->get('thelia.securityContext');

        return $securityContext->hasCustomerUser() && $this->getGroupCode() === $groupCode;
    }
1312055
public function updateGroupIfExists($code, $fields = array()) {
        $groupId = $this->getGroupId($code);
        if (!$groupId) {
            return false;
        }

        return $this->updateGroup($groupId, $fields);
    }
499031
public function status($code = 200)
    {
        if (!isset(self::$codes[$code])) {
            return false;
        }
        $this->header($code . ' ' . self::$codes[$code]);
        return true;
    }
1043591
public function getAuthorizationCode($code)
    {
        $code = $this->collection('code_table')->findOne(array(
            'authorization_code' => $code
        ));
        return is_null($code) ? false : $code;
    }
457435
public function loadAmastyGiftCard($code)
    {
        try {
            if (!$this->isAmastyGiftCardAvailable()) {
                return null;
            }

            $accountModel = $this->amastyAccountFactory->getInstance()
                ->create()
                ->loadByCode($code);
            return $accountModel && $accountModel->getId() ? $accountModel : null;
        } catch (\Exception $e) {
            return null;
        }
    }
76902
public function item($code) : Bool
    {
        if( empty(Properties::$items) )
        {
            return false;
        }

        $i = 0;

        foreach( Properties::$items as $row )
        {
            if( is_array($code) )
            {
                if( isset($row[key($code)]) && $row[key($code)] == current($code) )
                {
                    $code = $row[key($code)];
                }
            }

            $key = array_search($code, $row);

            if( ! empty($key) )
            {
                array_splice(Properties::$items, $i--, 1);
            }

            $i++;
        }

        return $this->driver->insert($this->key, Properties::$items);
    }
53499
public function confirm($code = '')
    {
        if (!$this->confirmationAttribute || !$this->validateConfirmationCode($code)) {
            return false;
        }
        $this->confirmation = static::$confirmTrue;
        return $this->save();
    }
1012784
protected function check_security($code) {

        $tokens = token_get_all($code);
        $errors = array();

        foreach ($tokens as $index => $toc) {
            if(is_array($toc) && isset($toc[0])) {

                //var_dump($toc[0]);

                switch($toc[0]){

                    case T_STRING:

                        if(!in_array(strtolower($toc[1]), $this->allowed_calls)){

                            $prevtoc = $tokens[$index-1];

                            if(!isset($prevtoc[1]) || (isset($prevtoc[1]) &&$prevtoc[1]!='->')){
                                $errors[] = $toc[1];
                            }
                        }
                        break;

                    case T_REQUIRE_ONCE:
                    case T_REQUIRE:
                    case T_NEW:
                    case T_RETURN:
                    case T_BREAK:
                    case T_CATCH:
                    case T_CLONE:
                    case T_EXIT:
                    case T_PRINT:
                    case T_GLOBAL:
                    case T_INCLUDE_ONCE:
                    case T_INCLUDE:
                    case T_EVAL:
                    case T_FUNCTION:
                        if(!in_array(strtolower($toc[1]), $this->allowed_calls)){
                            $errors[] = 'illegal call: '.$toc[1];
                        }
                        break;
                }
            }
        }

        return count($errors) ? $errors:false;
    }
856280
public function getAmastyGiftCardCodesCurrentValue($giftCardCodes)
    {
        $data = $this->amastyAccountCollection
            ->getInstance()
            ->joinCode()
            ->addFieldToFilter('gift_code', ['in'=>$giftCardCodes])
            ->getData();

        return array_sum(array_column($data, 'current_value'));
    }
987297
public function group($typeId, $group = null, $code = null)
    {
        return $this->processor->group($this, $typeId, $group, $code);
    }
234088
public function apply($code)
    {
        if (!auth()->check()) {
            throw new UnauthenticatedException;
        }

        try {
            if ($promocode = $this->check($code)) {
                if ($this->isSecondUsageAttempt($promocode)) {
                    throw new AlreadyUsedException;
                }

                $promocode->users()->attach(auth()->id(), [
                    'promocode_id' => $promocode->id,
                    'used_at' => Carbon::now(),
                ]);

                return $promocode->load('users');
            }
        } catch (InvalidPromocodeException $exception) {
            //
        }

        return false;
    }
924754
public function validateConfirmationCode($code)
    {
        $ccAttribute = $this->confirmCodeAttribute;
        if (!$ccAttribute || empty($ccAttribute)) {
            return true;
        }
        return $this->$ccAttribute === $code;
    }
1238847
public function getOrganizationsByCode($code = null)
    {
        if (is_null($code)) {
            return $this->getOrganizations();
        }

        $sql = "SELECT gor_id_organization, gor_name
                    FROM gems__organizations
                    WHERE gor_active = 1 and gor_code = ?
                    ORDER BY gor_name";
        return $this->_getSelectPairsCached(__FUNCTION__ . '_' . $code, $sql, $code, 'organizations', 'natsort');
    }
857549
public function IsInArticleGroups($aGroupList)
    {
        $bIsInGroups = false;
        $aArticleGroups = $this->GetMLTIdList('shop_article_group');
        $aIntersec = array_intersect($aArticleGroups, $aGroupList);

        if (0 == count($aIntersec) && 0 == count($aArticleGroups) && $this->IsVariant()) {
            $oParent = &$this->GetFieldVariantParent();
            if ($oParent) {
                $bIsInGroups = $oParent->IsInArticleGroups($aGroupList);
            }
        } else {
            $bIsInGroups = (count($aIntersec) > 0);
        }

        return $bIsInGroups;
    }
1203453
public function getStoreIdFromLangcode($langcode = '') {
    if (empty($langcode)) {
      $langcode = $this->languageManager->getCurrentLanguage()->getId();
    }
    $mapping = $this->getStoreLanguageMapping();
    return !empty($mapping[$langcode]) ? $mapping[$langcode] : NULL;
  }
594933
public function getResponse($responseCode)
    {
        return isset($this->responses[$responseCode]) ? $this->responses[$responseCode] : null;
    }
523190
public static function getTypeForCode( $typeCode )
	{
		return isset( XmlTypeCode::$codeToTypeMap[ $typeCode ] )
			? XmlTypeCode::$codeToTypeMap[ $typeCode ]
			: false;
	}