public static function Caster::castFieldItem

8.0.x Caster.php public static Caster::castFieldItem($item, $array, $stub, $isNested)
master Caster.php public static Caster::castFieldItem($item, $array, $stub, $isNested)

Casts \Drupal\Core\Field\FieldItemInterface classes.

File

lib/Drush/Psysh/Caster.php, line 46
Contains \Drush\Psysh\Caster.

Namespace

Drush\Psysh

Class

Caster
Caster class for VarDumper casters for the shell.

Code

public static function castFieldItem($item, $array, $stub, $isNested) {
  if (!$isNested) {
    $array[BaseCaster::PREFIX_VIRTUAL . 'value'] = $item->getValue();
  }

  return $array;
}