public function getClassesInfo($nids) {
    $data = [];
    $tags = [];
    $cid = 'openy_repeat:classes_info' . md5(json_encode($nids));
    if ($cache = $this->cache->get($cid)) {
      $data = $cache->data;
    }
    else {
      $nids_chunked = array_chunk($nids, 20, TRUE);
      foreach ($nids_chunked as $chunk) {
        $classes = $this->entityTypeManager->getStorage('node')->loadMultiple($chunk);
        if (!empty($classes)) {
          foreach ($classes as $node) {
            $data[$node->nid->value] = [
              'nid' => $node->nid->value,
              'path' => $node->toUrl()->setAbsolute()->toString(),
              'title' => $node->title->value,
              'description' => html_entity_decode(strip_tags(text_summary($node->field_class_description->value, $node->field_class_description->format, 600))),
            ];
            $tags[] = 'node:' . $node->nid->value;
          }
        }
      }
      $this->cache->set($cid, $data, CacheBackendInterface::CACHE_PERMANENT, $tags);
    }

    return $data;
  }
public function getClassesInfo($nids) {
    $data = [];
    $tags = [];
    $cid = 'openy_repeat:classes_info' . md5(json_encode($nids));
    if ($cache = $this->cache->get($cid)) {
      $data = $cache->data;
    }
    else {
      $nids_chunked = array_chunk($nids, 20, TRUE);
      foreach ($nids_chunked as $chunk) {
        $classes = $this->entityTypeManager->getStorage('node')->loadMultiple($chunk);
        if (!empty($classes)) {
          foreach ($classes as $node) {
            $data[$node->nid->value] = [
              'nid' => $node->nid->value,
              'path' => $node->toUrl()->setAbsolute()->toString(),
              'title' => $node->title->value,
              'description' => html_entity_decode(strip_tags(text_summary($node->field_class_description->value, $node->field_class_description->format, 600))),
            ];
            $tags[] = 'node:' . $node->nid->value;
          }
        }
      }
      $this->cache->set($cid, $data, CacheBackendInterface::CACHE_PERMANENT, $tags);
    }

    return $data;
  }
public function getClassesInfo ( $ nids ) { $ data = [ ] ; $ tags = [ ] ; $ cid = 'openy_repeat:classes_info' . md5 ( json_encode ( $ nids ) ) ; if ( $ cache = $ this -> cache -> get ( $ cid ) ) { $ data = $ cache -> data ; } else { $ nids_chunked = array_chunk ( $ nids , 20 , TRUE ) ; foreach ( $ nids_chunked as $ chunk ) { $ classes = $ this -> entityTypeManager -> getStorage ( 'node' ) -> loadMultiple ( $ chunk ) ; if ( ! empty ( $ classes ) ) { foreach ( $ classes as $ node ) { $ data [ $ node -> nid -> value ] = [ 'nid' => $ node -> nid -> value , 'path' => $ node -> toUrl ( ) -> setAbsolute ( ) -> toString ( ) , 'title' => $ node -> title -> value , 'description' => html_entity_decode ( strip_tags ( text_summary ( $ node -> field_class_description -> value , $ node -> field_class_description -> format , 600 ) ) ) , ] ; $ tags [ ] = 'node:' . $ node -> nid -> value ; } } } $ this -> cache -> set ( $ cid , $ data , CacheBackendInterface :: CACHE_PERMANENT , $ tags ) ; } return $ data ; }
Get detailed info about Class.
Get detailed info about Class .