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',
],
],
...
];
파일 보기
프로젝트 열기: 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()
공개 메소드
createDbTransaction()
보호된 메소드
createTransaction()
보호된 메소드
findTransaction()
보호된 메소드
incrementAccountBalance()
보호된 메소드
프로퍼티 상세
name of the ActiveRecord class, which should store account records.
$transactionClass 공개적으로 프로퍼티
name of the ActiveRecord class, which should store transaction records.