Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Transactions in PHQL

I just a have a question. Is it possible to do transactions with PHQL?



83.4k
Accepted
answer

Yes, you can:

$this->db->begin();

$this->manager->executeQuery("INSERT INTO Cars VALUES (NULL, 'Lamborghini Espada', 7, 10000.00, 1969, 'Grand Tourer')");
$this->manager->executeQuery("INSERT INTO Cars VALUES (NULL, 'Lamborghini Espada', 7, 10000.00, 1969, 'Grand Tourer')");
$this->manager->executeQuery("INSERT INTO Cars VALUES (NULL, 'Lamborghini Espada', 7, 10000.00, 1969, 'Grand Tourer')");

$this->db->commit();