You are here

public function SerializableStrategy::getSerializer in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-hydrator/src/Strategy/SerializableStrategy.php \Zend\Hydrator\Strategy\SerializableStrategy::getSerializer()

Get serializer

Return value

SerializerAdapter

2 calls to SerializableStrategy::getSerializer()
SerializableStrategy::extract in vendor/zendframework/zend-hydrator/src/Strategy/SerializableStrategy.php
Serialize the given value so that it can be extracted by the hydrator.
SerializableStrategy::hydrate in vendor/zendframework/zend-hydrator/src/Strategy/SerializableStrategy.php
Unserialize the given value so that it can be hydrated by the hydrator.

File

vendor/zendframework/zend-hydrator/src/Strategy/SerializableStrategy.php, line 90

Class

SerializableStrategy

Namespace

Zend\Hydrator\Strategy

Code

public function getSerializer() {
  if (is_string($this->serializer)) {
    $options = $this
      ->getSerializerOptions();
    $this
      ->setSerializer(SerializerFactory::factory($this->serializer, $options));
  }
  elseif (null === $this->serializer) {
    $this
      ->setSerializer(SerializerFactory::getDefaultAdapter());
  }
  return $this->serializer;
}