+ /**
+ * Create all rows of this rowset
+ * @param bool $txn
+ * @return \pq\Gateway\Rowset
+ * @throws Exception
+ */
+ function create($txn = true) {
+ $txn = $txn ? $this->table->getConnection()->startTransaction() : false;
+ try {
+ foreach ($this->rows as $row) {
+ $row->create();
+ }
+ } catch (\Exception $e) {
+ if ($txn) {
+ $txn->rollback();
+ }
+ throw $e;
+ }
+ if ($txn) {
+ $txn->commit();
+ }