예제 #1
0
파일: Cache.php 프로젝트: mage2pro/core
 /**
  * @param string $key
  * @param mixed $value
  * @return void
  */
 public function saveDataComplex($key, $value)
 {
     if ($this->isEnabled()) {
         $this->saveData($key, df_serialize($value));
     }
 }
예제 #2
0
파일: O.php 프로젝트: mage2pro/core
 /**
  * @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());
     }
 }