Skip to content

Instantly share code, notes, and snippets.

\Drupal::languageManager()->getCurrentLanguage()->getId();
$term = Term::load($node->get('field_...')->target_id);
$term->getName();
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($nids);
$node = \Drupal::entityTypeManager()->getStorage('node')->load($nid);
$query = \Drupal::entityQuery('node')
->condition('status', 1) // published
->condition('type', 'article')
->condition('langcode', $langcode)
->range(0, 10)
->sort('created', 'DESC');
$nids = $query->execute();
try {
\Drupal::entityDefinitionUpdateManager()->applyUpdates();
}
catch (EntityStorageException $e) {
print_r($e);
}
@Kloport
Kloport / Set components folder
Created September 3, 2016 07:45
Create a Bower configuration file .bowerrc in the project root with the following content:
{
"directory" : "app/vendors"
}