entityTypeManager = \Drupal::entityTypeManager(); } /** * Compute the values. */ protected function computeValue() { $query = \Drupal::entityQuery('commerce_product') ->condition('status', 1) ->sort('created', 'ASC') // ->exists('field_visuel') // ->condition('type', 'article') ->range(0,12); $ids = $query->execute(); foreach ($ids as $key => $id) { $this->list[$key] = $this->createItem($key, $id); } } }