4
如何获取被引用实体的实例?
我有一个节点对象,其图像字段名为field_image。当我做 $node ->get('field_image') ->first() ->getValue() 我得到一些属性而不是实体对象的数组。该数组如下所示: 'target_id' => string '8' (length=1) 'alt' => string '' (length=0) 'title' => string '' (length=0) 'width' => string '587' (length=3) 'height' => string '458' (length=3) '_loaded' => boolean true '_accessCacheability' => object(Drupal\Core\Cache\CacheableMetadata)[1092] protected 'cacheContexts' => array (size=0) ... protected 'cacheTags' => array (size=0) ... …