/**
  * @return string
  */
 public function serialize()
 {
     if ($this instanceof ExtraDataInterface) {
         return \Heystack\Core\serialize([$this->toMap(), $this->getExtraData()]);
     }
     return \Heystack\Core\serialize($this->toMap());
 }
 /**
  * @param string $key
  * @param mixed|null $val
  * @return void
  */
 public function setByKey($key, $val)
 {
     if ($this->getEnabled()) {
         $this->backend->setByKey($key, \Heystack\Core\serialize($val));
     }
 }
 /**
  * Returns a serialized string from the data array
  * @return string
  */
 public function serialize()
 {
     return \Heystack\Core\serialize($this->getData());
 }