Provides access to an attribute of the current brand

@param  array $params
@param  \Smarty $smarty
@return string the value of the requested attribute
482427
public function brandDataAccess($params, &$smarty)
    {
        $brandId = $this->getRequest()->get('brand_id');

        if ($brandId === null) {
            $productId = $this->getRequest()->get('product_id');

            if ($productId !== null) {
                if (null !== $product = ProductQuery::create()->findPk($productId)) {
                    $brandId = $product->getBrandId();
                }
            }
        }

        if ($brandId !== null) {
            return $this->dataAccessWithI18n(
                "Brand",
                $params,
                BrandQuery::create()->filterByPrimaryKey($brandId)
            );
        }

        return '';
    }
1291341
public static function getSmartyInstance(string $appFullName = null):\Smarty
    {
        if (self::$instance == null) {
            if (self::$appCall != $appFullName) {
                self::$appCall = $appFullName;
                ;
                new SmartyEngineTemplate();
            }
        }
        return (self::$instance);
    }
181804
public function moduleConfigDataAccess($params, $smarty)
    {
        $key = $this->getParam($params, 'key', false);
        $moduleCode = $this->getParam($params, 'module', false);
        $locale = $this->getParam($params, 'locale');

        if (null === $locale) {
            $locale = $this->getSession()->getLang()->getLocale();
        }

        if ($key === false || $moduleCode === false) {
            return null;
        }

        $default = $this->getParam($params, 'default', '');

        if (null !== $module = ModuleQuery::create()->findOneByCode($moduleCode)) {
            return ModuleConfigQuery::create()
                ->getConfigValue(
                    $module->getId(),
                    $key,
                    $default,
                    $locale
                );
        } else {
            Tlog::getInstance()->addWarning(
                sprintf(
                    "Module code '%s' not found in module-config Smarty function",
                    $moduleCode
                )
            );

            $value = $default;
        }

        return $value;
    }
1314795
public function getParamTokens(array $params)
    {
        foreach ($params as $k => $p) {
            if (is_array($p)) {
                $params[$k] = isset($p[2]) ? $p[2] : 0;
            }
        }

        return $params;
    }
1076018
private function getFullName(array $params): string
    {
        if (isset($params['full_name'])) {
            return $this->get($params, 'full_name', '');
        }

        return trim(sprintf('%s %s', $this->get($params, 'first', ''), $this->get($params, 'last', '')));
    }
455610
protected function getSignature(array $params):string {
		ksort($params);

		$signature = '';

		foreach($params as $k => $v){
			if(!in_array($k, ['format', 'callback'])){
				$signature .= $k.$v;
			}
		}

		return md5($signature.$this->options->secret);
	}
437457
public function itemsFilterIds($params){
		if(empty($params['orderby'])){
			$params['orderby']=$this->leftKeyName;
			}
		return parent::itemsFilterIds($params);
		}
381447
protected function _smartyCompileCheck($smarty)
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $smarty->compile_check = $config->getConfigParam('blCheckTemplates');
    }
1158115
protected function getTemplateUid(Smarty $smarty, $resource_name)
    {
        if (isset($resource_name)) {
            $source = Smarty_Template_Source::load(null, $smarty, $resource_name);
            if ($source->exists) {
                return $source->uid;
            }
        }
        return '';
    }
1164419
public static function load(Smarty $smarty, $type = null)
    {
        if (!isset($type)) {
            $type = $smarty->caching_type;
        }

        // try smarty's cache
        if (isset($smarty->_cacheresource_handlers[$type])) {
            return $smarty->_cacheresource_handlers[$type];
        }

        // try registered resource
        if (isset($smarty->registered_cache_resources[$type])) {
            // do not cache these instances as they may vary from instance to instance
            return $smarty->_cacheresource_handlers[$type] = $smarty->registered_cache_resources[$type];
        }
        // try sysplugins dir
        if (isset(self::$sysplugins[$type])) {
            if (!isset(self::$resources[$type])) {
                $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
                self::$resources[$type] = new $cache_resource_class();
            }

            return $smarty->_cacheresource_handlers[$type] = self::$resources[$type];
        }
        // try plugins dir
        $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
        if ($smarty->loadPlugin($cache_resource_class)) {
            if (!isset(self::$resources[$type])) {
                self::$resources[$type] = new $cache_resource_class();
            }

            return $smarty->_cacheresource_handlers[$type] = self::$resources[$type];
        }
        // give up
        throw new SmartyException("Unable to load cache resource '{$type}'");
    }
341241
public function getMatch($params = array())
    {
        $resource = 'vendor/match.json';
        $resource .= '?' . $this->buildQueryString($params);
        $response = $this->getServiceResponse($resource);

        $getVendorMatchResponse = new Models\ResponseVendorMatchGet($response);

        return $getVendorMatchResponse;
    }
404051
protected function cacheKey(array $params = [])
    {
        $prefix   = config('antares/ui-components::cache');
        $required = ['resource', 'uid', 'brand_id', 'name'];
        if (count(array_only($params, $required)) != count($required)) {
            return $prefix;
        }
        $ordered = [];
        foreach ($required as $key) {
            $ordered[$key] = array_get($params, $key);
        }
        return implode('.', array_merge([config('antares/ui-components::cache')], $ordered));
    }
153672
public function search($params)
    {
        $query = ProductUnitEquivalent::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'product_unit_1' => $this->product_unit_1,
            'product_unit_1_value' => $this->product_unit_1_value,
            'product_unit_2' => $this->product_unit_2,
            'product_unit_2_value' => $this->product_unit_2_value,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
            'created_by' => $this->created_by,
            'updated_by' => $this->updated_by,
        ]);

        return $dataProvider;
    }
830506
public function form_label($params) {
        if (!isset($params['text'])) {
            throw new \UnexpectedValueException("The text parameter is required.");
        }
        $id = isset($params['id']) ? $params['id'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        return Form::label($params['text'], $id, $attributes);
    }
664734
public function getSingle($sQuery, array $aParam = []) {
		if (!$aRow = $this->getRow($sQuery, $aParam)) {
			return FALSE;
		}
		return current($aRow);
	}
700816
public function invalidLoadedCache(Smarty $smarty)
    {
        $smarty->_cache['isCached'] = array();
        if (isset($smarty->ext->_subtemplate)) {
            $smarty->ext->_subtemplate->tplObjects = array();
        }
    }
519008
protected function getSmarty()
    {
        $smarty = new \Smarty();
        $currentDirectory = dirname(__FILE__);
        $smarty->template_dir = realpath(
            $currentDirectory . DIRECTORY_SEPARATOR .
            'smarty' . DIRECTORY_SEPARATOR .
            'templates' . DIRECTORY_SEPARATOR
        );
        $smarty->compile_dir = realpath(
            $currentDirectory . '' . DIRECTORY_SEPARATOR .
            'smarty' . DIRECTORY_SEPARATOR .
            'templates_c' . DIRECTORY_SEPARATOR
        );
        $smarty->left_delimiter = '{{';
        $smarty->right_delimiter = '}}';

        return $smarty;
    }