New answers tagged

1 vote

Update database issue

As @4uk4 points out, this issue happened to me because of an old composer. Updating composer to its latest version and dumping autoload worked for me: composer.phar self-update composer.phar dump-...
TrilceAC's user avatar
  • 111
0 votes

Database query with like condition

If you are interested in syntax for query() (not for condition()) then here how to use like: $db = \Drupal::database(); $oldTablesPrefix = $db->escapeLike('old_') . '%'; $oldTables = $db->query('...
Vlad Moyseenko's user avatar
0 votes

How do I get both published and unpublished records using entity query?

// Setup query to find show nearest to recording timestamp $query = \Drupal::database()->select('node__field_programme_broadcast', 'nfp') ->fields('nfp', ['entity_id', '...
Chris Reeve's user avatar

Top 50 recent answers are included