PHP 클래스 Xpressengine\Tag\TagHandler

### app binding : xe.tag 로 바인딩 되어 있음 Tag Facade 로 접근이 가능 ### 등록 및 반환 php 등록 각각의 인스턴스를 구분하기위해 대상의 인스턴스 아이디가 전달되어야 합니다. Tag::set('instanceId', 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', ['word1', 'word2', 'word3']); 반환 $tags = Tag::get('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'); ### 자동 완성 단어를 쉽게 완성할 수 있도록 기존에 등록된 단어중 입력중인 문자와 유사한 단어들을 검색하여 반환해줍니다. php $tags = Tag::autoCompletion('ap'); app, application, apm, append, apple ...
저자: XE Team (developers) ([email protected])
파일 보기 프로젝트 열기: xpressengine/xpressengine 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$decomposer Decomposer Decomposer instance
$model string Tag model

공개 메소드들

메소드 설명
__construct ( Decomposer $decomposer ) TagHandler constructor.
createModel ( ) : Tag Create tag model
getModel ( ) : string Returns tag model
set ( string $taggableId, array $words, string | null $instanceId = null ) : Illuminate\Database\Eloquent\Collection Set taggable's tags
setModel ( string $model ) Set tag model
similar ( string $string, integer $take = 15, string | null $instanceId = null ) : Illuminate\Database\Eloquent\Collection | static[] Search similar tags by given string
similarWord ( string $string, integer $take = 15, string | null $instanceId = null ) : array Search similar words by given string

보호된 메소드들

메소드 설명
attach ( string $taggableId, ArrayAccess | array $tags ) : void Attach tag to taggable
detach ( string $taggableId, ArrayAccess | array $tags ) : void Detach tag to taggable

비공개 메소드들

메소드 설명
multisort ( array $std, array $tags ) : array Sort tags by given words

메소드 상세

__construct() 공개 메소드

TagHandler constructor.
public __construct ( Decomposer $decomposer )
$decomposer Decomposer Decomposer instance

attach() 보호된 메소드

Attach tag to taggable
protected attach ( string $taggableId, ArrayAccess | array $tags ) : void
$taggableId string taggable id
$tags ArrayAccess | array tag instances
리턴 void

createModel() 공개 메소드

Create tag model
public createModel ( ) : Tag
리턴 Tag

detach() 보호된 메소드

Detach tag to taggable
protected detach ( string $taggableId, ArrayAccess | array $tags ) : void
$taggableId string taggable id
$tags ArrayAccess | array tag instances
리턴 void

getModel() 공개 메소드

Returns tag model
public getModel ( ) : string
리턴 string

set() 공개 메소드

Set taggable's tags
public set ( string $taggableId, array $words, string | null $instanceId = null ) : Illuminate\Database\Eloquent\Collection
$taggableId string taggable id
$words array tag word
$instanceId string | null instance id of taggable
리턴 Illuminate\Database\Eloquent\Collection model collection

setModel() 공개 메소드

Set tag model
public setModel ( string $model )
$model string model class

similar() 공개 메소드

Search similar tags by given string
public similar ( string $string, integer $take = 15, string | null $instanceId = null ) : Illuminate\Database\Eloquent\Collection | static[]
$string string partial of word
$take integer take count
$instanceId string | null instance id of taggable
리턴 Illuminate\Database\Eloquent\Collection | static[]

similarWord() 공개 메소드

Search similar words by given string
public similarWord ( string $string, integer $take = 15, string | null $instanceId = null ) : array
$string string partial of word
$take integer take count
$instanceId string | null instance id of taggable
리턴 array

프로퍼티 상세

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

Decomposer instance
protected Decomposer,Xpressengine\Tag $decomposer
리턴 Decomposer

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

Tag model
protected string $model
리턴 string