/** * Delete a list of ids from the `core_url_rewrite` table * * @param $deleteList int[] - List of ids to delete * @return int - Nr of ids deleted */ protected function cleanRewrites($deleteList) { $count = 0; if (!empty($deleteList)) { $chunks = array_chunk($deleteList, 100); foreach ($chunks as $chunk) { $sql = sprintf('DELETE FROM %s WHERE `url_rewrite_id` IN (%s)', $this->writeAdapter->quoteIdentifier($this->table), $this->writeAdapter->quote($chunk)); $stmt = $this->writeAdapter->query($sql); $count += $stmt->rowCount(); $stmt->closeCursor(); } echo "."; flush(); } return $count; }