PHP Класс Xpressengine\Counter\Counter

* Factory 에 의해서 인스턴스 생성 * $name, $options 멤버 변수를 이용해서 등록, 조회, 삭제할 때 counter_logs 테이블의 counterName, counterOption 컬럼에 사용 * $name 에 따라 여러 유형의 Counter 인스턴스를 만들 수 있음 * $options 는 $name 에서 사용할 option 항목
Автор: XE Developers ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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