public function getMembershipData() {
    // @todo fix cache life time.
    $cid = __METHOD__;
    if ($cache = $this->cacheBackend->get($cid)) {
      $data = $cache->data;
    }
    else {
      $data = [];

      $daxko_branch_ids = $this->locationRepo->getAllDaxkoBranchIds();
      foreach ($daxko_branch_ids as $branch_id) {
        $data[$branch_id] = $this->daxkoClient->getMembershipTypes(['branch_id' => $branch_id]);
      }

      $this->cacheBackend->set($cid, $data);
    }

    return $data;
  }
public function getMembershipData() {
    // @todo fix cache life time.
    $cid = __METHOD__;
    if ($cache = $this->cacheBackend->get($cid)) {
      $data = $cache->data;
    }
    else {
      $data = [];

      $daxko_branch_ids = $this->locationRepo->getAllDaxkoBranchIds();
      foreach ($daxko_branch_ids as $branch_id) {
        $data[$branch_id] = $this->daxkoClient->getMembershipTypes(['branch_id' => $branch_id]);
      }

      $this->cacheBackend->set($cid, $data);
    }

    return $data;
  }
public function getMembershipData ( ) { // @todo fix cache life time. $ cid = __METHOD__ ; if ( $ cache = $ this -> cacheBackend -> get ( $ cid ) ) { $ data = $ cache -> data ; } else { $ data = [ ] ; $ daxko_branch_ids = $ this -> locationRepo -> getAllDaxkoBranchIds ( ) ; foreach ( $ daxko_branch_ids as $ branch_id ) { $ data [ $ branch_id ] = $ this -> daxkoClient -> getMembershipTypes ( [ 'branch_id' => $ branch_id ] ) ; } $ this -> cacheBackend -> set ( $ cid , $ data ) ; } return $ data ; }
Get membership data from Daxko.

This method creates a cache bin with the data.
Please, use this method with cron to populate the data.

@return array
Data.
Get membership data from Daxko .