How to get field collection values from user object? I added a field collection to the user 'manage field' page, the field machine name is 'houses'. The user may add as many home he want. 

This field collection regroup :


a sample text plain field (the name of the house), the machine name
"house_name"
a sample integer field (the size of the house), the
machine name "house_size"


In a custom module, I want load the current user and get values of all values of all his houses (in an array ?), how can I do that ? 

I tried this : 

$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()-&gt;id());
$user_houses = $user-&gt;get('field_houses')-&gt;getValue();
ksm($user_houses);


But I get : 



It's ok, I set 8 houses in "user edit" page, so I get an array of 8 entries. But, I would like get all data in an array like this : 

house 1 : name1 : size1
house 2 : name2 : size2
...
house 8 : name8 : size8


Thank you :)
I find =) 

With : 

use Drupal\field_collection\Entity\FieldCollectionItem;
...
$test = FieldCollectionItem::load(3);


Where "3" is, by example, a value returned by $user->get('field_houses')->getValue();