Sulu\Component\Cache\CacheInterface::write PHP Method

write() public method

Write data into cache.
public write ( Serializable | Serializable[] $data )
$data Serializable | Serializable[]
    public function write($data);

Usage Example

Example #1
0
 /**
  * Returns system collections.
  *
  * @return array
  */
 private function getSystemCollections()
 {
     if (!$this->systemCollections) {
         if (!$this->cache->isFresh()) {
             $systemCollections = $this->buildSystemCollections($this->locale, $this->getUserId());
             $this->cache->write($systemCollections);
         }
         $this->systemCollections = $this->cache->read();
     }
     return $this->systemCollections;
 }