LayoutEntityDisplayNormalizer.php

Same filename and directory in other branches
  1. 8.9.x core/modules/layout_builder/src/Normalizer/LayoutEntityDisplayNormalizer.php
  2. 10 core/modules/layout_builder/src/Normalizer/LayoutEntityDisplayNormalizer.php
  3. 11.x core/modules/layout_builder/src/Normalizer/LayoutEntityDisplayNormalizer.php

Namespace

Drupal\layout_builder\Normalizer

File

core/modules/layout_builder/src/Normalizer/LayoutEntityDisplayNormalizer.php

View source
<?php

namespace Drupal\layout_builder\Normalizer;

use Drupal\layout_builder\Entity\LayoutEntityDisplayInterface;
use Drupal\serialization\Normalizer\ConfigEntityNormalizer;

/**
 * Normalizes/denormalizes LayoutEntityDisplay objects into an array structure.
 *
 * @internal
 *   Tagged services are internal.
 */
class LayoutEntityDisplayNormalizer extends ConfigEntityNormalizer {
    
    /**
     * {@inheritdoc}
     */
    protected $supportedInterfaceOrClass = LayoutEntityDisplayInterface::class;
    
    /**
     * {@inheritdoc}
     */
    protected static function getDataWithoutInternals(array $data) {
        $data = parent::getDataWithoutInternals($data);
        // Do not expose the actual layout sections in normalization.
        // @todo Determine what to expose here in
        //   https://www.drupal.org/node/2942975.
        unset($data['third_party_settings']['layout_builder']['sections']);
        return $data;
    }
    
    /**
     * {@inheritdoc}
     */
    public function hasCacheableSupportsMethod() : bool {
        return TRUE;
    }

}

Classes

Title Deprecated Summary
LayoutEntityDisplayNormalizer Normalizes/denormalizes LayoutEntityDisplay objects into an array structure.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.