PHP 인터페이스 Cartalyst\Tags\TaggableInterface

파일 보기 프로젝트 열기: cartalyst/tags

공개 메소드들

메소드 설명
addTag ( string $name ) : void Attaches the given tag to the entity.
allTags ( ) : Builder Returns all the tags under the entity namespace.
createTagsModel ( ) : Model Creates a new model instance.
getSlugGenerator ( ) : string Returns the slug generator.
getTagsDelimiter ( ) : string Returns the tags delimiter.
getTagsModel ( ) : string Returns the Eloquent tags model name.
prepareTags ( string | array $tags ) : array Prepares the given tags before being saved.
removeTag ( string $name ) : void Detaches the given tag from the entity.
scopeWhereTag ( Builder $query, string | array $tags, string $type = 'slug' ) : Builder Returns the entities with only the given tags.
scopeWithTag ( Builder $query, string | array $tags, string $type = 'slug' ) : Builder Returns the entities with one of the given tags.
scopeWithoutTag ( Builder $query, string | array $tags, string $type = 'slug' ) : Builder Returns the entities that do not have one of the given tags.
setSlugGenerator ( string $name ) : void Sets the slug generator.
setTags ( string | array $tags, string $type = 'name' ) : boolean Attaches or detaches the given tags.
setTagsDelimiter ( string $delimiter ) Sets the tags delimiter.
setTagsModel ( string $model ) : void Sets the Eloquent tags model name.
tag ( string | array $tags ) : boolean Attaches multiple tags to the entity.
tags ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany Returns the entity Eloquent tag model object.
untag ( string | array | null $tags = null ) : boolean Detaches multiple tags from the entity or if no tags are passed, removes all the attached tags from the entity.

메소드 상세

addTag() 공개 메소드

Attaches the given tag to the entity.
public addTag ( string $name ) : void
$name string
리턴 void

allTags() 공개 정적인 메소드

Returns all the tags under the entity namespace.
public static allTags ( ) : Builder
리턴 Illuminate\Database\Eloquent\Builder

createTagsModel() 공개 정적인 메소드

Creates a new model instance.
public static createTagsModel ( ) : Model
리턴 Illuminate\Database\Eloquent\Model

getSlugGenerator() 공개 정적인 메소드

Returns the slug generator.
public static getSlugGenerator ( ) : string
리턴 string

getTagsDelimiter() 공개 정적인 메소드

Returns the tags delimiter.
public static getTagsDelimiter ( ) : string
리턴 string

getTagsModel() 공개 정적인 메소드

Returns the Eloquent tags model name.
public static getTagsModel ( ) : string
리턴 string

prepareTags() 공개 메소드

Prepares the given tags before being saved.
public prepareTags ( string | array $tags ) : array
$tags string | array
리턴 array

removeTag() 공개 메소드

Detaches the given tag from the entity.
public removeTag ( string $name ) : void
$name string
리턴 void

scopeWhereTag() 공개 정적인 메소드

Returns the entities with only the given tags.
public static scopeWhereTag ( Builder $query, string | array $tags, string $type = 'slug' ) : Builder
$query Illuminate\Database\Eloquent\Builder
$tags string | array
$type string
리턴 Illuminate\Database\Eloquent\Builder

scopeWithTag() 공개 정적인 메소드

Returns the entities with one of the given tags.
public static scopeWithTag ( Builder $query, string | array $tags, string $type = 'slug' ) : Builder
$query Illuminate\Database\Eloquent\Builder
$tags string | array
$type string
리턴 Illuminate\Database\Eloquent\Builder

scopeWithoutTag() 공개 정적인 메소드

Returns the entities that do not have one of the given tags.
public static scopeWithoutTag ( Builder $query, string | array $tags, string $type = 'slug' ) : Builder
$query Illuminate\Database\Eloquent\Builder
$tags string | array
$type string
리턴 Illuminate\Database\Eloquent\Builder

setSlugGenerator() 공개 정적인 메소드

Sets the slug generator.
public static setSlugGenerator ( string $name ) : void
$name string
리턴 void

setTags() 공개 메소드

Attaches or detaches the given tags.
public setTags ( string | array $tags, string $type = 'name' ) : boolean
$tags string | array
$type string
리턴 boolean

setTagsDelimiter() 공개 정적인 메소드

Sets the tags delimiter.
public static setTagsDelimiter ( string $delimiter )
$delimiter string

setTagsModel() 공개 정적인 메소드

Sets the Eloquent tags model name.
public static setTagsModel ( string $model ) : void
$model string
리턴 void

tag() 공개 메소드

Attaches multiple tags to the entity.
public tag ( string | array $tags ) : boolean
$tags string | array
리턴 boolean

tags() 공개 메소드

Returns the entity Eloquent tag model object.
public tags ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany
리턴 Illuminate\Database\Eloquent\Relations\MorphToMany

untag() 공개 메소드

Detaches multiple tags from the entity or if no tags are passed, removes all the attached tags from the entity.
public untag ( string | array | null $tags = null ) : boolean
$tags string | array | null
리턴 boolean