public function SerializableStrategy::setSerializer in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-hydrator/src/Strategy/SerializableStrategy.php \Zend\Hydrator\Strategy\SerializableStrategy::setSerializer()
Set serializer
Parameters
string|SerializerAdapter $serializer:
Return value
2 calls to SerializableStrategy::setSerializer()
- SerializableStrategy::getSerializer in vendor/
zendframework/ zend-hydrator/ src/ Strategy/ SerializableStrategy.php - Get serializer
- SerializableStrategy::__construct in vendor/
zendframework/ zend-hydrator/ src/ Strategy/ SerializableStrategy.php
File
- vendor/
zendframework/ zend-hydrator/ src/ Strategy/ SerializableStrategy.php, line 71
Class
Namespace
Zend\Hydrator\StrategyCode
public function setSerializer($serializer) {
if (!is_string($serializer) && !$serializer instanceof SerializerAdapter) {
throw new InvalidArgumentException(sprintf('%s expects either a string serializer name or Zend\\Serializer\\Adapter\\AdapterInterface instance; ' . 'received "%s"', __METHOD__, is_object($serializer) ? get_class($serializer) : gettype($serializer)));
}
$this->serializer = $serializer;
return $this;
}