I need to embedded a php code in my web made with Drupal 9 because I need to migrate a database (that use a query with php code) made in Drupal 6 to my new web. I see that in the old web I can choose an input format "php code" for this page in order to embedded the php code, by using the PHP filter module. How could I do for Drupal 9? I was searching a module but I couldn't find anything.
I'm experimenting with how to customize an auto-complete field.
Filter the nodes in bae to various parameters
The code is this
$storage = \Drupal::entityTypeManager()->getStorage('node');
$qry = $storage->getQuery()
->condition( 'type', 'anagrafica_richiedenti' )
->condition('status', 1)
->condition('field_attivo', 1)
->sort( 'title', 'ASC' )
->execute();
I am trying to merge some of the node detail to custom table because of project requirement. Whatever I try, the below code is unable to fetch the entity-id(); and entity field value.