copy() 최종 공개 메소드

Creates a copy of the encapsulated options.
final public copy ( ) : array
리턴 array Options.
예제 #1
0
 public function fetch($source, EncapsulatedOptions $options = null)
 {
     $optionsCopy = $options ? $options->copy() : [];
     if ($this->isCacheEnabled()) {
         ksort($optionsCopy);
         $hash = $this->hash([$source, $optionsCopy]);
         if ($this->cache->hasItem($hash)) {
             return $this->cache->getItem($hash)->get();
         }
     }
     $data = $this->fetchFreshData($source, $options);
     isset($hash) && $this->cache->save($this->cache->getItem($hash)->set($data));
     return $data;
 }