Esempio n. 1
0
 /**
  * @param Entity $entity
  * @return array
  */
 public function transform(Entity $entity)
 {
     $data = $entity->toArray();
     if (count($this->fieldIncludes) > 0) {
         $this->filterIncludes($data);
     }
     if (count($this->fieldExcludes) > 0) {
         $this->filterEntityForExcludes($data);
     }
     // remove docType key as it's only used internally
     unset($data['docType']);
     return $data;
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function update(Entity $entity)
 {
     $id = $entity->getId();
     $this->bucket->replace($this->makeKey($id), $entity->toArray());
     return $entity;
 }