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])
Afficher le fichier Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Свойство Type Description
$decomposer Decomposer Decomposer instance
$model string Tag model

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode Description
multisort ( array $std, array $tags ) : array Sort tags by given words

Method Details

__construct() public méthode

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

attach() protected méthode

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

createModel() public méthode

Create tag model
public createModel ( ) : Tag
Résultat Tag

detach() protected méthode

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

getModel() public méthode

Returns tag model
public getModel ( ) : string
Résultat string

set() public méthode

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
Résultat Illuminate\Database\Eloquent\Collection model collection

setModel() public méthode

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

similar() public méthode

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

similarWord() public méthode

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
Résultat array

Property Details

$decomposer protected_oe property

Decomposer instance
protected Decomposer,Xpressengine\Tag $decomposer
Résultat Decomposer

$model protected_oe property

Tag model
protected string $model
Résultat string