public function metaAccess($params, $smarty)
    {
        $meta = $this->getParam($params, 'meta', null);
        $key = $this->getParam($params, 'key', null);
        $id = $this->getParam($params, 'id', null);

        $cacheKey = sprintf('meta_%s_%s_%s', $meta, $key, $id);

        $out = null;

        if (array_key_exists($cacheKey, self::$dataAccessCache)) {
            return self::$dataAccessCache[$cacheKey];
        }

        if ($key !== null && $id !== null) {
            if ($meta === null) {
                $out = MetaDataQuery::getAllVal($key, (int) $id);
            } else {
                $out = MetaDataQuery::getVal($meta, $key, (int) $id);
            }
        } else {
            throw new \InvalidArgumentException("key and id arguments are required in meta access function");
        }

        self::$dataAccessCache[$cacheKey] = $out;

        if (!empty($params['out'])) {
            $smarty->assign($params['out'], $out);

            return $out !== null ? true : false;
        } else {
            if (is_array($out)) {
                throw new \InvalidArgumentException('The argument "out" is required if the meta value is an array');
            }

            return $out;
        }
    }