public function getProgramsByBranchAndCategory($branch_id, $category) {
    $cid = __METHOD__ . $branch_id . md5($category);
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $params = [
      'branch' => $branch_id,
      'tag' => $category,
    ];

    $data = [];
    $result = $this->client->getSessions($params);
    foreach ($result as $item) {
      $program = new \stdClass();
      $program->id = $item->programId;
      $program->name = $item->programName;
      $data[] = $program;
    }

    $this->cache->set($cid, $data);
    return $data;
  }
public function getProgramsByBranchAndCategory($branch_id, $category) {
    $cid = __METHOD__ . $branch_id . md5($category);
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $params = [
      'branch' => $branch_id,
      'tag' => $category,
    ];

    $data = [];
    $result = $this->client->getSessions($params);
    foreach ($result as $item) {
      $program = new \stdClass();
      $program->id = $item->programId;
      $program->name = $item->programName;
      $data[] = $program;
    }

    $this->cache->set($cid, $data);
    return $data;
  }
public function getProgramsByBranchAndCategory ( $ branch_id , $ category ) { $ cid = __METHOD__ . $ branch_id . md5 ( $ category ) ; if ( $ cache = $ this -> cache -> get ( $ cid ) ) { return $ cache -> data ; } $ params = [ 'branch' => $ branch_id , 'tag' => $ category , ] ; $ data = [ ] ; $ result = $ this -> client -> getSessions ( $ params ) ; foreach ( $ result as $ item ) { $ program = new \ stdClass ( ) ; $ program -> id = $ item -> programId ; $ program -> name = $ item -> programName ; $ data [ ] = $ program ; } $ this -> cache -> set ( $ cid , $ data ) ; return $ data ; }
Get programs by branch and category.

@param int $branch_id
Branch ID.
@param string $category
Category IDs.

@return array
Programs.
Get programs by branch and category .