📜  drupal 8 获取字段实体 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:26.409000             🧑  作者: Mango

代码示例1
// Get first field reference entity.
$entity->get('field_entity_reference')->entity;

// Get all field reference entities.
$entities = $entity->get('field_entity_reference')->referencedEntities();