Created
February 8, 2016 17:21
-
-
Save lasekio/a80f93d54c678e258366 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
$account = $accountRepo->getAccount($id); | |
$accountBalance = $account->getBalance(); | |
// nawet w tym momencie balance moze sie zmienic przez inny wątek / request / przerwanie | |
// nie należy spodziewać się, że kod będzie wykonywany zawsze synchronicznie | |
$accountBalance += $transaction->getAmount(); | |
// jeszcze jakieś rzeczy | |
$account->getBalance($accountBalance); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment