Counter
class Counter
Counter
- Factory 에 의해서 인스턴스 생성
- $name, $options 멤버 변수를 이용해서 등록, 조회, 삭제할 때 counter_logs 테이블의 counterName, counterOption 컬럼에 사용
- $name 에 따라 여러 유형의 Counter 인스턴스를 만들 수 있음
- $options 는 $name 에서 사용할 option 항목
Properties
protected | $model | model class name | |
protected Request | $request | ||
protected string | $name | 카운터 이름 | |
protected array | $options | 카운터에 사용할 선택 항목 | |
protected bool | $guest | 비회원 지원 |
Methods
void
setGuest(bool $use = true)
비회원 지원 설정
string
getName()
get name
array
getOptions()
get options
void
checkOption(string $option)
check option
void
bool
bool
void
void
CounterLog|null
CounterLog|null
getByName(string $targetId, UserInterface $user = null)
get log by name 옵션을 사용하는 Counter 에서 로그를 확인 할 때 등록된 옵션은 제외하고 확인하려고 할 수 있음
int
getPoint(string $targetId, string $option = '')
get point sum
void
array
getUsers(string $targetId, string $option = '')
get users
string
getModel()
The name of CounterLog model class
newModel()
Create model instance
Details
at line 82
__construct(Request $request, string $name, array $options = array())
Counter constructor.
at line 95
void
setGuest(bool $use = true)
비회원 지원 설정
at line 105
string
getName()
get name
at line 115
array
getOptions()
get options
at line 127
protected void
checkOption(string $option)
check option
at line 143
protected void
checkGuest(UserInterface $user = null)
check support guest
at line 157
bool
hasByName(string $targetId, UserInterface $user = null)
has by name
at line 170
bool
has(string $targetId, UserInterface $user = null, string $option = '')
has log
at line 184
void
add(string $targetId, UserInterface $user = null, string $option = '', int $point = 1)
add log
at line 214
void
remove(string $targetId, UserInterface $user = null, string $option = '')
remove log
at line 236
CounterLog|null
get(string $targetId, UserInterface $user = null, string $option = '')
get log
at line 256
CounterLog|null
getByName(string $targetId, UserInterface $user = null)
get log by name 옵션을 사용하는 Counter 에서 로그를 확인 할 때 등록된 옵션은 제외하고 확인하려고 할 수 있음
at line 274
int
getPoint(string $targetId, string $option = '')
get point sum
at line 291
void
putPoint(string $targetId, UserInterface $user = null, string $option = '', int $point = 1)
put log
at line 320
array
getUsers(string $targetId, string $option = '')
get users
at line 339
string
getModel()
The name of CounterLog model class
at line 349
CounterLog
newModel()
Create model instance