PHP 클래스 Xpressengine\Counter\Counter

* Factory 에 의해서 인스턴스 생성 * $name, $options 멤버 변수를 이용해서 등록, 조회, 삭제할 때 counter_logs 테이블의 counterName, counterOption 컬럼에 사용 * $name 에 따라 여러 유형의 Counter 인스턴스를 만들 수 있음 * $options 는 $name 에서 사용할 option 항목
저자: XE Developers ([email protected])
파일 보기 프로젝트 열기: xpressengine/xpressengine 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$guest boolean 비회원 지원
$model model class name
$name string 카운터 이름
$options array 카운터에 사용할 선택 항목
$request Xpressengine\Http\Request

공개 메소드들

메소드 설명
__construct ( Request $request, string $name, array $options = [] ) Counter constructor.
add ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '', integer $point = 1 ) : void add log
get ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '' ) : CounterLog | null get log
getByName ( string $targetId, Xpressengine\User\UserInterface $user = null ) : CounterLog | null get log by name 옵션을 사용하는 Counter 에서 로그를 확인 할 때 등록된 옵션은 제외하고 확인하려고 할 수 있음
getModel ( ) : string The name of CounterLog model class
getName ( ) : string get name
getOptions ( ) : array get options
getPoint ( string $targetId, string $option = '' ) : integer get point sum
getUsers ( string $targetId, string $option = '' ) : array get users
has ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '' ) : boolean has log
hasByName ( string $targetId, Xpressengine\User\UserInterface $user = null ) : boolean has by name
newModel ( ) : CounterLog Create model instance
putPoint ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '', integer $point = 1 ) : void put log
remove ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '' ) : void remove log
setGuest ( boolean $use = true ) : void 비회원 지원 설정

보호된 메소드들

메소드 설명
checkGuest ( Xpressengine\User\UserInterface $user = null ) : void check support guest
checkOption ( string $option ) : void check option

메소드 상세

__construct() 공개 메소드

Counter constructor.
public __construct ( Request $request, string $name, array $options = [] )
$request Xpressengine\Http\Request request
$name string counter name
$options array counter options

add() 공개 메소드

add log
public add ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '', integer $point = 1 ) : void
$targetId string target id
$user Xpressengine\User\UserInterface user instance
$option string counter option
$point integer point
리턴 void

checkGuest() 보호된 메소드

check support guest
protected checkGuest ( Xpressengine\User\UserInterface $user = null ) : void
$user Xpressengine\User\UserInterface user
리턴 void

checkOption() 보호된 메소드

check option
protected checkOption ( string $option ) : void
$option string counter option
리턴 void

get() 공개 메소드

get log
public get ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '' ) : CounterLog | null
$targetId string target id
$user Xpressengine\User\UserInterface user instance
$option string counter option
리턴 Xpressengine\Counter\Models\CounterLog | null

getByName() 공개 메소드

get log by name 옵션을 사용하는 Counter 에서 로그를 확인 할 때 등록된 옵션은 제외하고 확인하려고 할 수 있음
public getByName ( string $targetId, Xpressengine\User\UserInterface $user = null ) : CounterLog | null
$targetId string target id
$user Xpressengine\User\UserInterface user instance
리턴 Xpressengine\Counter\Models\CounterLog | null

getModel() 공개 메소드

The name of CounterLog model class
public getModel ( ) : string
리턴 string

getName() 공개 메소드

get name
public getName ( ) : string
리턴 string

getOptions() 공개 메소드

get options
public getOptions ( ) : array
리턴 array

getPoint() 공개 메소드

get point sum
public getPoint ( string $targetId, string $option = '' ) : integer
$targetId string target id
$option string counter option
리턴 integer

getUsers() 공개 메소드

get users
public getUsers ( string $targetId, string $option = '' ) : array
$targetId string target id
$option string counter option
리턴 array

has() 공개 메소드

has log
public has ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '' ) : boolean
$targetId string target id
$user Xpressengine\User\UserInterface user instance
$option string counter option
리턴 boolean

hasByName() 공개 메소드

has by name
public hasByName ( string $targetId, Xpressengine\User\UserInterface $user = null ) : boolean
$targetId string targetId
$user Xpressengine\User\UserInterface user instance
리턴 boolean

newModel() 공개 메소드

Create model instance
public newModel ( ) : CounterLog
리턴 Xpressengine\Counter\Models\CounterLog

putPoint() 공개 메소드

put log
public putPoint ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '', integer $point = 1 ) : void
$targetId string target id
$user Xpressengine\User\UserInterface user instance
$option string counter option
$point integer point
리턴 void

remove() 공개 메소드

remove log
public remove ( string $targetId, Xpressengine\User\UserInterface $user = null, string $option = '' ) : void
$targetId string target id
$user Xpressengine\User\UserInterface user instance
$option string counter option
리턴 void

setGuest() 공개 메소드

비회원 지원 설정
public setGuest ( boolean $use = true ) : void
$use boolean guest support flag
리턴 void

프로퍼티 상세

$guest 보호되어 있는 프로퍼티

비회원 지원
protected bool $guest
리턴 boolean

$model 보호되어 있는 프로퍼티

model class name
protected $model

$name 보호되어 있는 프로퍼티

카운터 이름
protected string $name
리턴 string

$options 보호되어 있는 프로퍼티

카운터에 사용할 선택 항목
protected array $options
리턴 array

$request 보호되어 있는 프로퍼티

protected Request,Xpressengine\Http $request
리턴 Xpressengine\Http\Request