/** * @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; }
/** * @inheritdoc */ public function update(Entity $entity) { $id = $entity->getId(); $this->bucket->replace($this->makeKey($id), $entity->toArray()); return $entity; }