public function toPersistenceValue(SPIValue $value) { return new PersistenceValue(array("data" => $value->__toString(), "externalData" => $value !== null ? $value->toHash() : null, "sortKey" => null)); }