public function getKeyValues(Entity $entity, array $keys)
    {
        $scope = $this->config('scope');
        $query = $this->_table->query();

        $query
            ->where([
                'scope' => $scope,
                $this->config('fields.key') . ' IN' => $keys
            ])
            ->hydrate(false);

        // unserialize serialized fields
        $query->formatResults(function (ResultSet $results) {
            return $results->map(function ($row) {
                if ($row['serialized'] === true) {
                    $row['value'] = unserialize($row['value']);
                }
                return $row;
            });
        });

        foreach ($query->all() as $row) {
            $entity->{$row[$this->config('fields.key')]} = $row[$this->config('fields.value')];
        }

        return $entity;
    }