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; }