Skip to content

Instantly share code, notes, and snippets.

@vijaycs85
Created February 7, 2017 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijaycs85/83824c48dac6daae617f9492b43f3a15 to your computer and use it in GitHub Desktop.
Save vijaycs85/83824c48dac6daae617f9492b43f3a15 to your computer and use it in GitHub Desktop.
<?php
$storage = $this->entityManager->getStorage($entity_type);
$ids = $storage->getQuery()
->condition('type', $type)
->execute();
$entities = $storage->loadMultiple($ids);
// Load the entities.
foreach ($entities as $entity) {
$entity->[field name] = $value;
$entity->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment