PHP Class 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 ...
Author: XE Team (developers) ([email protected])
ファイルを表示 Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Property Type Description
$decomposer Decomposer Decomposer instance
$model string Tag model

Public Methods

Method Description
__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

Protected Methods

Method Description
attach ( string $taggableId, ArrayAccess | array $tags ) : void Attach tag to taggable
detach ( string $taggableId, ArrayAccess | array $tags ) : void Detach tag to taggable

Private Methods

Method Description
multisort ( array $std, array $tags ) : array Sort tags by given words

Method Details

__construct() public method

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

attach() protected method

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

createModel() public method

Create tag model
public createModel ( ) : Tag
return Tag

detach() protected method

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

getModel() public method

Returns tag model
public getModel ( ) : string
return string

set() public method

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
return Illuminate\Database\Eloquent\Collection model collection

setModel() public method

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

similar() public method

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
return Illuminate\Database\Eloquent\Collection | static[]

similarWord() public method

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
return array

Property Details

$decomposer protected_oe property

Decomposer instance
protected Decomposer,Xpressengine\Tag $decomposer
return Decomposer

$model protected_oe property

Tag model
protected string $model
return string