doctrine/data-fixtures — pull request #127 by ddeboer (2014-01-15 13:29:26+00:00)
Title: Fix truncate on MySQL >= 5.5

When loading fixtures with purge mode truncate (`--purge-with-truncate` in the bundle's command) on MySQL >= 5.5, an error is thrown:

```mysql
SQLSTATE[42000]: Syntax error or access violation:
1701 Cannot truncate a table referenced in a foreign key constraint ...
```

It turns out that with MySQL 5.5, the `TRUNCATE` behaviour has changed. From the [MySQL docs](http://dev.mysql.com/doc/refman/5.5/en/truncate-table.html):

> TRUNCATE TABLE fails for an InnoDB table if there are any FOREIGN KEY constraints from other tables that reference the table. Foreign key constraints between columns of the same table are permitted.

With this PR foreign key checks are disabled before starting the purge, and re-enabled after, so purge made truncate works again.