/**
  * Fetch a collection of replace fields
  * @param array $arr_where - Optional
  * @param boolean $use_cache - Optional. Defaults to FALSE
  * @return StdClass
  */
 public function fetchReplaceFields($arr_where = array(), $use_cache = FALSE)
 {
     //check if data is cached
     $this->objCache = $this->getServiceLocator()->get("FrontCore\\Caches\\Cache");
     if ($use_cache == TRUE && $this->objCache->readCacheItem($this->cache_key) != FALSE) {
         return $this->objCache->readCacheItem($this->cache_key);
     }
     //end if
     //create the request object
     $objApiRequest = $this->getApiRequestModel();
     //setup the object and specify the action
     $objApiRequest->setApiAction("forms/fields/replace");
     //execute
     $objFields = $objApiRequest->performGETRequest($arr_where)->getBody();
     //save data to cache
     $this->objCache->setCacheItem($this->cache_key, $objFields->data, array("ttl" => 3600));
     return $objFields->data;
 }
 /**
  * Retrieve data from disk
  * @return mixed
  */
 private function readFile()
 {
     $r = $this->setPath();
     if (!$r) {
         return $r;
     }
     //end if
     //check cache
     if ($this->objCache->readCacheItem($this->cache_key)) {
         return $this->objCache->readCacheItem($this->cache_key);
     }
     //end if
     //encode data
     $objData = json_decode(file_get_contents($this->path));
     //save to cache
     $this->objCache->setCacheItem($this->cache_key, $objData, array("ttl" => 5 * 60));
     return $objData;
 }