public function execute()
    {
        $result = null;
        // Only return the result of the primary query
        foreach ($this as $query) {
            /** @var QueryBuilder $query */
            try {
                if ($result === null) {
                    $result = $query->execute();
                    if ($query->getType() === 3) {
                        $this->setLastInsertId($query);
                    }
                    foreach ($this->resultCallbacks as $callback) {
                        $callback($query, $result, $this->getParentId());
                    }
                } else {
                    foreach ($this->resultCallbacks as $callback) {
                        $callback($query, $result, $this->getParentId());
                    }
                    $query->execute();
                }
            } catch (\Exception $e) {
                throw $e;
            }
        }

        return $result;
    }
public function execute()
    {
        $result = null;
        // Only return the result of the primary query
        foreach ($this as $query) {
            /** @var QueryBuilder $query */
            try {
                if ($result === null) {
                    $result = $query->execute();
                    if ($query->getType() === 3) {
                        $this->setLastInsertId($query);
                    }
                    foreach ($this->resultCallbacks as $callback) {
                        $callback($query, $result, $this->getParentId());
                    }
                } else {
                    foreach ($this->resultCallbacks as $callback) {
                        $callback($query, $result, $this->getParentId());
                    }
                    $query->execute();
                }
            } catch (\Exception $e) {
                throw $e;
            }
        }

        return $result;
    }
public function execute ( ) { $ result = null ; // Only return the result of the primary query foreach ( $ this as $ query ) { /** @var QueryBuilder $query */ try { if ( $ result === null ) { $ result = $ query -> execute ( ) ; if ( $ query -> getType ( ) === 3 ) { $ this -> setLastInsertId ( $ query ) ; } foreach ( $ this -> resultCallbacks as $ callback ) { $ callback ( $ query , $ result , $ this -> getParentId ( ) ) ; } } else { foreach ( $ this -> resultCallbacks as $ callback ) { $ callback ( $ query , $ result , $ this -> getParentId ( ) ) ; } $ query -> execute ( ) ; } } catch ( \ Exception $ e ) { throw $ e ; } } return $ result ; }
Execute function, iterate the queries, and execute them sequentially.

@throws \Exception

@return \Doctrine\DBAL\Driver\Statement|int|null
Execute function iterate the queries and execute them sequentially .