abstract class NormalizerBase

Same name in this branch

Base class for Normalizers.

Hierarchy

Expanded class hierarchy of NormalizerBase

1 file declares its use of NormalizerBase
NormalizerBase.php in drupal/core/modules/hal/lib/Drupal/hal/Normalizer/NormalizerBase.php
Contains \Drupal\hal\Normalizer\NormalizerBase.

File

drupal/core/modules/serialization/lib/Drupal/serialization/Normalizer/NormalizerBase.php, line 17
Contains \Drupal\serialization\Normalizer\NormalizerBase.

Namespace

Drupal\serialization\Normalizer
View source
abstract class NormalizerBase extends SerializerAwareNormalizer implements NormalizerInterface {

  /**
   * The interface or class that this Normalizer supports.
   *
   * @var string
   */
  protected $supportedInterfaceOrClass;

  /**
   * Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::supportsNormalization().
   */
  public function supportsNormalization($data, $format = NULL) {
    return is_object($data) && $data instanceof $this->supportedInterfaceOrClass;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NormalizerBase::$supportedInterfaceOrClass protected property The interface or class that this Normalizer supports. 6
NormalizerBase::supportsNormalization public function Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::supportsNormalization(). Overrides NormalizerInterface::supportsNormalization 1
NormalizerInterface::normalize public function Normalizes an object into a set of arrays/scalars 11
SerializerAwareNormalizer::$serializer protected property
SerializerAwareNormalizer::setSerializer public function Sets the owning Serializer object Overrides SerializerAwareInterface::setSerializer