Part of the cache_cacheableInterface

@param  mixed         $value
@param  string        $option
@param  int           $duration
@return caption_field
978674
public function set_data_to_cache($value, $option = null, $duration = 360000)
    {
        return self::$localCache[$this->get_cache_key($option)] = $value;
    }
783659
public function base64($value, array $options, $mode) {
        if ($mode === self::TO && $options['encode']) {
            return base64_encode($value);
        }

        if ($mode === self::FROM && $options['decode']) {
            return base64_decode($value);
        }

        return $value;
    }
1125612
public static function setCache($name, $value = '', $expired = 3600)
    {
        if (is_callable(self::$cache_callable['set'])) {
            return call_user_func_array(self::$cache_callable['set'], func_get_args());
        }
        $file = self::_getCacheName($name);
        $data = ['name' => $name, 'value' => $value, 'expired' => time() + intval($expired)];
        if (!file_put_contents($file, serialize($data))) {
            throw new LocalCacheException('local cache error.', '0');
        }
        return $file;
    }
720896
public function html($value, array $options, $mode) {
        if ($mode === self::TO && $options['encode']) {
            return htmlentities($value, $options['flags'], $options['encoding']);
        }

        if ($mode === self::FROM && $options['decode']) {
            return html_entity_decode($value, $options['flags'], $options['encoding']);
        }

        return $value;
    }
1099885
public function setCoreCacheResource($value)
    {
        $this->setFieldName('cache_resource');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
429571
public function setCoreCacheResourceExpires($value)
    {
        $this->setFieldName('cache_resource_expires');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1094834
public function setFieldDefinitionOption($option, $value)
    {
        $this->contentTypeContext->updateFieldDefinition(
            self::$fieldIdentifier,
            new FieldDefinitionUpdateStruct(['fieldSettings' => [$option => $value]])
        );
    }
1201581
protected function getCacheKey($value, $options)
    {
        if (is_scalar($value)) {
            $data = $value;
        } elseif (is_array($value) && 'eq' == strtolower($value[0])) {
            $data = $value[1];
        }

        if (isset($data)) {
            return 'mongo:' . $options['table'] . '|' . $data;
        } else {
            return md5(serialize($options));
        }
    }
638413
public function setOption($option, $value)
    {
        if ($this->isValidOption($option)) {
            $this->options[$option] = $value;
        }

        return $this;
    }
271222
public function setOption($option, $value)
    {
        if (array_key_exists($option, $this->options)) {
            $this->options[$option] = $value;
        }
        return $this;
    }
1132290
public function setToken($key, $value, $duration = 60)
    {
        $this->cache->put('reactor.tokens.' . $key, $value, $duration);
    }
254690
public function setOption($option, $value)
    {
        $option                 = strtolower($option);
        $this->options[$option] = $value;
        return $this;
    }
658878
public function put($key, $value, $duration, $localOnly = false)
    {
        $cacheKey = $this->cacheKey($key);
        if($this->keepLocalCache)
            $this->localCache[$cacheKey] = $value;
        if(!$localOnly)
            $this->cacheStore->put($cacheKey, $value, $duration);
    }
186398
public function cache($context, string $key, $value = '', int $expire = 0)
    {
        if ($value === '') {
            $commandData = [$context, $key];
            $command = 'get';
        } else {
            if (!empty($expire)) {
                $command = 'setex';
                $commandData = [$context, $key, $expire, $value];
            } else {
                $command = 'set';
                $commandData = [$context, $key, $value];
            }
        }

        return $this->__call($command, $commandData);
    }
330647
public function setOption($option, $value) {
        switch ($option) {
            case self::OPT_THREAD_FLAGS:
                $this->setThreadStartFlags($value); break;
            case self::OPT_POOL_SIZE_MIN:
                $this->setPoolSizeMin($value); break;
            case self::OPT_POOL_SIZE_MAX:
                $this->setPoolSizeMax($value); break;
            case self::OPT_TASK_TIMEOUT:
                $this->setTaskTimeout($value); break;
            case self::OPT_IDLE_WORKER_TIMEOUT:
                $this->setIdleWorkerTimeout($value); break;
            case self::OPT_EXEC_LIMIT:
                $this->setExecutionLimit($value); break;
            case self::OPT_IPC_URI:
                $this->setIpcUri($value); break;
            case self::OPT_UNIX_IPC_DIR:
                $this->setUnixIpcSocketDir($value); break;
            default:
                throw new \DomainException(
                    sprintf('Unknown option: %s', $option)
                );
        }

        return $this;
    }
1000431
protected function pack($field, $value, $options) {
        switch ($options['type']) {
            case 'int':
                return intval($value);
            case 'float':
                return floatval($value);
            case 'list':
                return implode(',', $value);
            case 'array':
            case 'json':
                return @json_encode($value);
            case 'bool':
                return in_array(strtolower($value), ['on', 'yes', '1', 'enabled']) ? 1 : 0;
            case 'datetime':
            case 'date':
                $time = $value ? @strtotime($value) : 0;

                return $time === false ? 0 : $time;
            case 'number':
                if ($options['typef']) {
                    $typef = intval(trim($options['typef']));

                    return number_format($value, $typef, '.', '');
                } else {
                    return number_format($value, 3, '.', '');
                }
            default:
                return $value;
        }
    }
710090
public function put($key, $value, $duration, $localOnly = false)
    {
        return parent::put($key, $value, $this->cacheExpiration);
    }