public static function Caster::castContentEntity

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

Casts \Drupal\Core\Entity\ContentEntityInterface classes.

File

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

Namespace

Drush\Psysh

Class

Caster
Caster class for VarDumper casters for the shell.

Code

public static function castContentEntity($entity, $array, $stub, $isNested) {
  if (!$isNested) {
    foreach ($entity as $property => $item) {
      $array[BaseCaster::PREFIX_PROTECTED . $property] = $item;
    }
  }

  return $array;
}