PHP 클래스 Cviebrock\EloquentTaggable\Services\TagService

파일 보기 프로젝트 열기: cviebrock/eloquent-taggable

공개 메소드들

메소드 설명
buildTagArray ( string | array $tags ) : array Convert a delimited string into an array of tag strings.
buildTagArrayNormalized ( string | array $tags ) : array Convert a delimited string into an array of normalized tag strings.
find ( string $tagName ) : Tag | null Find an existing tag by name.
findOrCreate ( string $tagName ) : Tag Find an existing tag (or create a new one) by name.
getAllTags ( Model | string $class ) : Illuminate\Database\Eloquent\Collection Get all Tags for the given class.
joinList ( array $array ) : string Join a list of strings together using glue.
makeTagArray ( Model $model, string $field = 'name' ) : array Build a simple array of a model's tags.
makeTagList ( Model $model, string $field = 'name' ) : string Build a delimited string from a model's tags.
normalize ( string $string ) : mixed Normalize a string.

메소드 상세

buildTagArray() 공개 메소드

Convert a delimited string into an array of tag strings.
public buildTagArray ( string | array $tags ) : array
$tags string | array
리턴 array

buildTagArrayNormalized() 공개 메소드

Convert a delimited string into an array of normalized tag strings.
public buildTagArrayNormalized ( string | array $tags ) : array
$tags string | array
리턴 array

find() 공개 메소드

Find an existing tag by name.
public find ( string $tagName ) : Tag | null
$tagName string
리턴 Cviebrock\EloquentTaggable\Models\Tag | null

findOrCreate() 공개 메소드

Find an existing tag (or create a new one) by name.
public findOrCreate ( string $tagName ) : Tag
$tagName string
리턴 Cviebrock\EloquentTaggable\Models\Tag

getAllTags() 공개 메소드

Get all Tags for the given class.
public getAllTags ( Model | string $class ) : Illuminate\Database\Eloquent\Collection
$class Illuminate\Database\Eloquent\Model | string
리턴 Illuminate\Database\Eloquent\Collection

joinList() 공개 메소드

Join a list of strings together using glue.
public joinList ( array $array ) : string
$array array
리턴 string

makeTagArray() 공개 메소드

Build a simple array of a model's tags.
public makeTagArray ( Model $model, string $field = 'name' ) : array
$model Illuminate\Database\Eloquent\Model
$field string
리턴 array

makeTagList() 공개 메소드

Build a delimited string from a model's tags.
public makeTagList ( Model $model, string $field = 'name' ) : string
$model Illuminate\Database\Eloquent\Model
$field string
리턴 string

normalize() 공개 메소드

Normalize a string.
public normalize ( string $string ) : mixed
$string string
리턴 mixed