atk4\data\tests\smbo\Account::transfer PHP Method

transfer() public method

create and return a trasnfer model.
public transfer ( Account $a, $amount )
$a Account
    public function transfer(Account $a, $amount)
    {
        $t = new Transfer($this->persistence, ['detached' => true]);
        $t['account_id'] = $this->id;
        $t['destination_account_id'] = $a->id;
        $t['amount'] = -$amount;
        return $t;
    }