Miro Dieteker, Ursin Cola
Ne plus dupliquer les efforts pour identifier les ressources d'apprentissage pour les nouveaux venus en agence
Baddý Sonja
Berdir
SlidesSyntaxe à points
$ids = $nodeStorage->getQuery()
->condition('uid.entity.roles', 'administrator', '=')
->execute();
Drupal 10 nécessitera de le mentionner
Avoid using `loadByProperties` to load entities in #Drupal!https://t.co/pb7QWbE51y pic.twitter.com/HFMxxcy3Eh
— Matt Glaman (@nmdmatt) April 12, 2022
$ids = $nodeStorage->getQuery()
->condition('type', ['page', 'article'], 'IN')
->accessCheck(TRUE)
->execute();
$url = $entity->toUrl('canonical');
$link = $entity->toLink('Edit', 'edit-form');
Version non généralisable (liée au type d'entité)
$url = Url::fromRoute(
'entity.node.canonical',
['node' => $entity->id()]
);
$link = Link::createFromRoute(
'Edit',
'entity.node.edit_form',
['node' => $entity->id()])
);
https://www.drupal.org/docs/drupal-apis/entity-api/link-templates
$entity->setSyncing(TRUE);
$entity->save();
namespace Drupal\custom_node\Entity;
use Drupal\node\Entity\Node as CoreNode;
class CustomNode extends CoreNode {
// Implement whatever business logic specific to basic pages.
public function hasHighlightCategory(): bool {
if ($this->get('field_category')->entity) {
return $this->get('field_category')->get('entity')
->get('field_highlight')->value;
}
return FALSE;
}
}
Effet de bord sur tous les node, la class Node devient CustomNode, de manière globale.
class BasicPage extends Node implements BasicPageInterface {
// Implement whatever business logic specific to basic pages.
public function hasHighlightCategory(): bool {
if ($this->get('field_category')->entity) {
return $this->get('field_category')->get('entity')
->get('field_highlight')->value;
}
return FALSE;
}
}
Sascha Eggenberger
Slideshook_gin_content_form_routes()
Natalia Justicia
SlidesGábor Hojtsy
SlidesReste dans le core #3067261
SQLite vient avec l'extension json, MySQL reste 5.7.8+
Drupal recipes allow the automation of Drupal module install and configuration via the user interface and via the Drupal recipe composer plugin.
Jürgen Haas
SlidesDémo
Drupal Slack: #eca