Example #1
0
 /**
  * @return int
  */
 public function flush()
 {
     if ($this->hasChanged) {
         $this->hasChanged = false;
         return $this->fileReader->write($this->cache->read());
     }
     return 0;
 }
Example #2
0
 /**
  * @param mixed $data
  * @param int $mode
  * @return int
  */
 public function write($data, $mode = 0)
 {
     return $this->fileReader->write(json_encode($data, $this->flags), $mode);
 }
Example #3
0
 /**
  * @param mixed $dataList
  * @return int
  */
 public function set($dataList)
 {
     return $this->fileReader->write($dataList);
 }
Example #4
0
 /**
  * @param array $data
  * @param int $mode
  * @return int
  */
 public function write($data, $mode = 0)
 {
     return $this->fileReader->write($this->dataMapper->unmapObjects((array) $data), $mode);
 }