/** * Remover palavra * * @param string|array $word * @return void */ public static function deleteWords($word) { if (is_array($word)) { $query = ''; foreach ($word as $value) { $query .= "DELETE FROM WordDictionary WHERE Keyword = '" . static::connection()->escapeString(Str::lower(Str::withoutAccents($value))) . "';\n"; } static::connection()->exec($query); } else { $stmt = static::connection()->prepare('DELETE FROM WordDictionary WHERE Keyword = ?'); $stmt->bindValue(1, Str::lower(Str::withoutAccents($word)), SQLITE3_TEXT); $stmt->execute(); } }
/** * Inicia a instância * * @param $word */ public function __construct($word) { $this->word = $word; $this->length = Str::length($word); $this->keyword = Str::lower(Str::withoutAccents($word)); }