Get data from database

Created on 1 December 2022, over 1 year ago
Updated 27 March 2024, 3 months ago

How to get data/value from database. For example get title content type or node.

function computed_field_field_a_compute($entity_type_manager, $entity, $fields, $delta) {
$connection = \Drupal::service('database');
$query = $connection->select('node', 'n');
$query->join('users', 'u', 'n.uid = u.uid');
$qry = "SELECT * FROM {node} WHERE n.type = 'article'";
}

πŸ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024