public function getCategoryProgramInfo() {
    $data = [];
    $cid = 'openy_activity_finder:activity_program_info';
    if ($cache = $this->cache->get($cid)) {
      $data = $cache->data;
    }
    else {
      $nids = $this->entityQuery
        ->get('node')
        ->condition('type','program_subcategory')
        ->execute();
      $nids_chunked = array_chunk($nids, 20, TRUE);
      foreach ($nids_chunked as $chunked) {
        $program_subcategories = $this->entityTypeManager->getStorage('node')->loadMultiple($chunked);
        if (!empty($program_subcategories)) {
          foreach ($program_subcategories as $program_subcategory_node) {
            if ($program_node = $program_subcategory_node->field_category_program->entity) {
              $data[$program_subcategory_node->id()] = [
                'title' => $program_subcategory_node->title->value,
                'program' => [
                  'nid' => $program_node->id(),
                  'title' => $program_node->title->value,
                ],
              ];
            }
          }
        }
      }

      $expire = $this->time->getRequestTime() + self::CACHE_TTL;
      $this->cache->set($cid, $data, $expire);
    }

    return $data;
  }
public function getCategoryProgramInfo() {
    $data = [];
    $cid = 'openy_activity_finder:activity_program_info';
    if ($cache = $this->cache->get($cid)) {
      $data = $cache->data;
    }
    else {
      $nids = $this->entityQuery
        ->get('node')
        ->condition('type','program_subcategory')
        ->execute();
      $nids_chunked = array_chunk($nids, 20, TRUE);
      foreach ($nids_chunked as $chunked) {
        $program_subcategories = $this->entityTypeManager->getStorage('node')->loadMultiple($chunked);
        if (!empty($program_subcategories)) {
          foreach ($program_subcategories as $program_subcategory_node) {
            if ($program_node = $program_subcategory_node->field_category_program->entity) {
              $data[$program_subcategory_node->id()] = [
                'title' => $program_subcategory_node->title->value,
                'program' => [
                  'nid' => $program_node->id(),
                  'title' => $program_node->title->value,
                ],
              ];
            }
          }
        }
      }

      $expire = $this->time->getRequestTime() + self::CACHE_TTL;
      $this->cache->set($cid, $data, $expire);
    }

    return $data;
  }
public function getCategoryProgramInfo ( ) { $ data = [ ] ; $ cid = 'openy_activity_finder:activity_program_info' ; if ( $ cache = $ this -> cache -> get ( $ cid ) ) { $ data = $ cache -> data ; } else { $ nids = $ this -> entityQuery -> get ( 'node' ) -> condition ( 'type' , 'program_subcategory' ) -> execute ( ) ; $ nids_chunked = array_chunk ( $ nids , 20 , TRUE ) ; foreach ( $ nids_chunked as $ chunked ) { $ program_subcategories = $ this -> entityTypeManager -> getStorage ( 'node' ) -> loadMultiple ( $ chunked ) ; if ( ! empty ( $ program_subcategories ) ) { foreach ( $ program_subcategories as $ program_subcategory_node ) { if ( $ program_node = $ program_subcategory_node -> field_category_program -> entity ) { $ data [ $ program_subcategory_node -> id ( ) ] = [ 'title' => $ program_subcategory_node -> title -> value , 'program' => [ 'nid' => $ program_node -> id ( ) , 'title' => $ program_node -> title -> value , ] , ] ; } } } } $ expire = $ this -> time -> getRequestTime ( ) + self :: CACHE_TTL ; $ this -> cache -> set ( $ cid , $ data , $ expire ) ; } return $ data ; }
Get referencing chain for Session -> Program info.
Get referencing chain for Session - > Program info .