Skip to content

Commit e4e3c16

Browse files
committed
wip
1 parent 56dd62c commit e4e3c16

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

source/write/transaction.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,22 @@ following table describes these methods:
9595
Transaction Example
9696
-------------------
9797

98-
The following code defines the ``transferTxn()`` callback function that
99-
modifies data in the ``saving_accounts``, ``checking_accounts``, and ``receipts``
100-
collections of the ``bank`` database:
98+
This example defines a callback function that
99+
modifies data in the collections of the ``bank`` database for a
100+
banking transaction. The code performs the following actions:
101+
102+
- Creates ``Collection`` instances to access the target
103+
collections.
104+
- Specifies the account number and amount to be transferred between
105+
accounts.
106+
- Defines the callback function, passing the ``Session`` instance as a
107+
parameter.
108+
- Updates the customer's balances to reflect the money transfer.
109+
- Records a receipt of the transaction with a timestamp.
110+
- Prints a message if the transaction committed successfully.
101111

102112
.. literalinclude:: /includes/write/transaction.php
113+
:copyable:
103114
:language: php
104115
:dedent:
105116
:start-after: begin-callback
@@ -113,10 +124,10 @@ completes the following actions:
113124
passing the session and the callback as parameters.
114125

115126
.. io-code-block::
127+
:copyable:
116128

117129
.. input:: /includes/write/transaction.php
118130
:language: php
119-
:copyable:
120131
:dedent:
121132
:start-after: begin-txn
122133
:end-before: end-txn

0 commit comments

Comments
 (0)