Last active
September 24, 2018 10:04
-
-
Save init90/1125f84887e130ac1fbdae859b47dbb1 to your computer and use it in GitHub Desktop.
Drupal 8, get first field collection item.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($entity->get('FIELD_COLLECTION_FIELD')->count() > 0) { | |
$settings = $entity->get('FIELD_COLLECTION_FIELD')->first()->getFieldCollectionItem(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment