Skip to content

Instantly share code, notes, and snippets.

View jasonawant's full-sized avatar

Jason Want jasonawant

  • Red Hat
  • New Orleans, LA
View GitHub Profile
@jasonawant
jasonawant / cloudSettings
Created August 22, 2022 13:49 — forked from merauluka/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-04-22T06:14:30.148Z","extensionVersion":"v3.4.3"}
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Component\Utility\Html;
use \Drupal\node\Entity\Node;
function relater_node_presave(EntityInterface $node) {
if ($node->bundle() == 'my_custom_node') {
$embeds = _relater_get_embeds($node);
$node->field_my_entityref->setValue($embeds);