Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function convert(EntityInterface $entity)
 {
     $data = $entity->toArray();
     if (is_array($this->ignoreKeys) && !empty($this->ignoreKeys)) {
         foreach ($this->ignoreKeys as $key) {
             unset($data[$key]);
         }
     }
     return http_build_query($data);
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function convert(EntityInterface $entity)
 {
     $data = $entity->toArray(false);
     if (is_array($this->ignoreKeys) && !empty($this->ignoreKeys)) {
         foreach ($this->ignoreKeys as $key) {
             unset($data[$key]);
         }
     }
     $output = $this->flatten($data);
     return hash($this->type, $this->prefix . implode('', array_values($output)) . $this->suffix);
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function convert(EntityInterface $entity)
 {
     $data = $entity->toArray();
     return json_encode($data);
 }