Skip to main content
added 61 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

As an alternative you can do it in one line with an array function instead of a loop:

$ids = array_column($entity->toarray>autoren->getValue()['autoren'], 'target_id');

Edit: Use getValue() to only get the array of the field.

As an alternative you can do it in one line with an array function instead of a loop:

$ids = array_column($entity->toarray()['autoren'], 'target_id');

As an alternative you can do it in one line with an array function instead of a loop:

$ids = array_column($entity->autoren->getValue(), 'target_id');

Edit: Use getValue() to only get the array of the field.

Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

As an alternative you can do it in one line with an array function instead of a loop:

$ids = array_column($entity->toarray()['autoren'], 'target_id');