PHP Interface Cartalyst\Tags\TaggableInterface

Afficher le fichier Open project: cartalyst/tags

Méthodes publiques

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

Method Details

addTag() public méthode

Attaches the given tag to the entity.
public addTag ( string $name ) : void
$name string
Résultat void

allTags() public static méthode

Returns all the tags under the entity namespace.
public static allTags ( ) : Builder
Résultat Illuminate\Database\Eloquent\Builder

createTagsModel() public static méthode

Creates a new model instance.
public static createTagsModel ( ) : Model
Résultat Illuminate\Database\Eloquent\Model

getSlugGenerator() public static méthode

Returns the slug generator.
public static getSlugGenerator ( ) : string
Résultat string

getTagsDelimiter() public static méthode

Returns the tags delimiter.
public static getTagsDelimiter ( ) : string
Résultat string

getTagsModel() public static méthode

Returns the Eloquent tags model name.
public static getTagsModel ( ) : string
Résultat string

prepareTags() public méthode

Prepares the given tags before being saved.
public prepareTags ( string | array $tags ) : array
$tags string | array
Résultat array

removeTag() public méthode

Detaches the given tag from the entity.
public removeTag ( string $name ) : void
$name string
Résultat void

scopeWhereTag() public static méthode

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
Résultat Illuminate\Database\Eloquent\Builder

scopeWithTag() public static méthode

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
Résultat Illuminate\Database\Eloquent\Builder

scopeWithoutTag() public static méthode

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
Résultat Illuminate\Database\Eloquent\Builder

setSlugGenerator() public static méthode

Sets the slug generator.
public static setSlugGenerator ( string $name ) : void
$name string
Résultat void

setTags() public méthode

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

setTagsDelimiter() public static méthode

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

setTagsModel() public static méthode

Sets the Eloquent tags model name.
public static setTagsModel ( string $model ) : void
$model string
Résultat void

tag() public méthode

Attaches multiple tags to the entity.
public tag ( string | array $tags ) : boolean
$tags string | array
Résultat boolean

tags() public méthode

Returns the entity Eloquent tag model object.
public tags ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany
Résultat Illuminate\Database\Eloquent\Relations\MorphToMany

untag() public méthode

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