/** * @param string $key * @param mixed $value * @return void */ public function saveDataComplex($key, $value) { if ($this->isEnabled()) { $this->saveData($key, df_serialize($value)); } }
/** * @param string $propertyName * @param string $cacheKey * @return void */ private function cacheSaveProperty($propertyName, $cacheKey) { $cacheKey = $cacheKey . $propertyName; /** @var mixed $propertyValue */ $propertyValue = $this->{$propertyName}; /** @var string|bool $propertyValueSerialized */ $propertyValueSerialized = isset($this->_cachedPropertiesSimpleMap[$propertyName]) ? df_serialize_simple($propertyValue) : df_serialize($propertyValue); if ($propertyValueSerialized) { df_cache_save($data = $propertyValueSerialized, $id = $cacheKey, $tags = df_array($this->cacheTags()), $lifeTime = $this->cacheLifetime()); } }