我正在尝试查询某种类型的所有段落,但是没有任何输出。我的查询正确吗?当前正在返回一个空数组。
$query = $this->node->getQuery()
->condition('type', 'my_paragraph_type')
->execute();
$this->logger->info('query: ' . json_encode($query));
答案 0 :(得分:0)
尝试使用entityQuery('entity_type')
$pids = \Drupal::entityQuery('paragraph')
->condition('type', 'my_paragraph_type')
->execute();