public function save(ResourceInterface $resource): bool
    {
        if (!parent::save($resource)) {
            return false;
        }

        $key = $this->generateKey(
            $resource->getType(),
            $resource->getId(),
            ['locale' => $this->getResourceLocale($resource)]
        );

        if ($this->autoWarmup && \in_array($resource->getType(), $this->warmupTypes, true)) {
            $cacheItem = $this->cacheItemPool->getItem($key);
            if (!$cacheItem->isHit()) {
                $cacheItem->set(guzzle_json_encode($resource));
                $this->cacheItemPool->save($cacheItem);
            }
        }

        return true;
    }
public function save(ResourceInterface $resource): bool
    {
        if (!parent::save($resource)) {
            return false;
        }

        $key = $this->generateKey(
            $resource->getType(),
            $resource->getId(),
            ['locale' => $this->getResourceLocale($resource)]
        );

        if ($this->autoWarmup && \in_array($resource->getType(), $this->warmupTypes, true)) {
            $cacheItem = $this->cacheItemPool->getItem($key);
            if (!$cacheItem->isHit()) {
                $cacheItem->set(guzzle_json_encode($resource));
                $this->cacheItemPool->save($cacheItem);
            }
        }

        return true;
    }
public function save ( ResourceInterface $ resource ) : bool { if ( ! parent :: save ( $ resource ) ) { return false ; } $ key = $ this -> generateKey ( $ resource -> getType ( ) , $ resource -> getId ( ) , [ 'locale' => $ this -> getResourceLocale ( $ resource ) ] ) ; if ( $ this -> autoWarmup && \ in_array ( $ resource -> getType ( ) , $ this -> warmupTypes , true ) ) { $ cacheItem = $ this -> cacheItemPool -> getItem ( $ key ) ; if ( ! $ cacheItem -> isHit ( ) ) { $ cacheItem -> set ( guzzle_json_encode ( $ resource ) ) ; $ this -> cacheItemPool -> save ( $ cacheItem ) ; } } return true ; }
{@inheritdoc}
{