Service/GearmanCacheWrapper.php
public function load(Cache $cache, $cacheId)
    {
        if ($cache->contains($cacheId)) {

            /**
             * Cache contains gearman structure
             */
            $this->workerCollection = $cache->fetch($cacheId);

        } else {

            /**
             * Cache is empty.
             *
             * Full structure must be generated and cached
             */
            $this->workerCollection = $this
                ->getGearmanParser()
                ->load()
                ->toArray();

            $cache->save($cacheId, $this->workerCollection);
        }

        return $this;
    }
public function load(Cache $cache, $cacheId)
    {
        if ($cache->contains($cacheId)) {

            /**
             * Cache contains gearman structure
             */
            $this->workerCollection = $cache->fetch($cacheId);

        } else {

            /**
             * Cache is empty.
             *
             * Full structure must be generated and cached
             */
            $this->workerCollection = $this
                ->getGearmanParser()
                ->load()
                ->toArray();

            $cache->save($cacheId, $this->workerCollection);
        }

        return $this;
    }
public function load ( Cache $ cache , $ cacheId ) { if ( $ cache -> contains ( $ cacheId ) ) { /**
             * Cache contains gearman structure
             */ $ this -> workerCollection = $ cache -> fetch ( $ cacheId ) ; } else { /**
             * Cache is empty.
             *
             * Full structure must be generated and cached
             */ $ this -> workerCollection = $ this -> getGearmanParser ( ) -> load ( ) -> toArray ( ) ; $ cache -> save ( $ cacheId , $ this -> workerCollection ) ; } return $ this ; }
loads Gearman cache, only if is not loaded yet

@param Cache  $cache   Cache instance
@param string $cacheId Cache id

@return GearmanCacheWrapper self Object
loads Gearman cache only if is not loaded yet