Exemple #1
0
 function getUpdateCommand()
 {
     return \DBAL\Query::build(\DBAL\Query::SQL)->update($this->getResource());
 }
Exemple #2
0
 function __invoke()
 {
     $errors = false;
     $connection = $this->getConnection();
     $platform = $this->getPlatform();
     $this->begin();
     $driver = $this->getDriver();
     try {
         $result = parent::__invoke();
         if ($driver->errors()) {
             throw new \DBAL\Exception('Transaction query failed to execute:');
         }
     } catch (\Exception $e) {
         var_dump($e->getMessage());
         $errors = true;
     }
     if ($errors) {
         $this->rollback();
     } else {
         $this->commit();
     }
     return $result;
 }