private function rewrite($data)
    {
        $text = json_encode($data);
        if ($this->isEncrypted() && strlen($text) > 0) {
            $text = Crypto::encryptWithPassword($text, $this->key, true);
        }
        file_put_contents($this->file, $text);
        return $data;
    }
private function rewrite($data)
    {
        $text = json_encode($data);
        if ($this->isEncrypted() && strlen($text) > 0) {
            $text = Crypto::encryptWithPassword($text, $this->key, true);
        }
        file_put_contents($this->file, $text);
        return $data;
    }
private function rewrite ( $ data ) { $ text = json_encode ( $ data ) ; if ( $ this -> isEncrypted ( ) && strlen ( $ text ) > 0 ) { $ text = Crypto :: encryptWithPassword ( $ text , $ this -> key , true ) ; } file_put_contents ( $ this -> file , $ text ) ; return $ data ; }
Rewrites all data to the database.

@param array $data   the data to rewrite
@return array        the updated data set
Rewrites all data to the database .