PHP 클래스 yii2tech\balance\ManagerActiveRecord

This manager allows usage of any storage, which have ActiveRecord interface implemented, such as relational DB, MongoDB, Redis etc. However, it may lack efficiency comparing to the dedicated managers like ManagerDb or ManagerMongoDb. Configuration example: php return [ 'components' => [ 'balanceManager' => [ 'class' => 'yii2tech\balance\ManagerActiveRecord', 'accountClass' => 'app\models\BalanceAccount', 'transactionClass' => 'app\models\BalanceTransaction', 'accountBalanceAttribute' => 'balance', 'extraAccountLinkAttribute' => 'extraAccountId', 'dataAttribute' => 'data', ], ], ... ];
또한 보기: Manager
부터: 1.0
저자: Paul Klimov ([email protected])
상속: extends ManagerDbTransaction, use trait ManagerDataSerializeTrait
파일 보기 프로젝트 열기: yii2tech/balance

공개 프로퍼티들

프로퍼티 타입 설명
$accountClass name of the ActiveRecord class, which should store account records.
$transactionClass name of the ActiveRecord class, which should store transaction records.

공개 메소드들

메소드 설명
calculateBalance ( $account )

보호된 메소드들

메소드 설명
createAccount ( $attributes )
createDbTransaction ( )
createTransaction ( $attributes )
findAccountId ( $attributes )
findTransaction ( $id )
incrementAccountBalance ( $accountId, $amount )

메소드 상세

calculateBalance() 공개 메소드

public calculateBalance ( $account )

createAccount() 보호된 메소드

protected createAccount ( $attributes )

createDbTransaction() 보호된 메소드

protected createDbTransaction ( )

createTransaction() 보호된 메소드

protected createTransaction ( $attributes )

findAccountId() 보호된 메소드

protected findAccountId ( $attributes )

findTransaction() 보호된 메소드

protected findTransaction ( $id )

incrementAccountBalance() 보호된 메소드

protected incrementAccountBalance ( $accountId, $amount )

프로퍼티 상세

$accountClass 공개적으로 프로퍼티

name of the ActiveRecord class, which should store account records.
public $accountClass

$transactionClass 공개적으로 프로퍼티

name of the ActiveRecord class, which should store transaction records.
public $transactionClass