class TagRepository

TagRepository.php

Traits

Properties

static protected array $models model class name from EloquentRepositoryTrait

Methods

Model
update(Model $item, array $data = array())

update

bool|null
delete(Model $item)

delete

int
increment(Model $item, string $column, int $amount = 1)

Increment a column's value by a given amount.

int
decrement(Model $item, string $column, int $amount = 1)

Decrement a column's value by a given amount.

static string
getModel()

The name of Category model class

static void
setModel(string $model)

Set the name of Category model

Model
createModel()

Create model instance

Builder
query()

query

mixed
__call(string $name, array $arguments)

__call

void
attach(string $taggableId, Tag[] $tags)

Attach tag to taggable

void
detach(string $taggableId, Tag[] $tags)

Detach tag to taggable

Collection|Tag[]
fetchByTaggable(string $taggableId)

Returns tags of the taggable

Collection|Tag[]
fetchPopular(string|null $instanceId = null, int $take = 15)

Returns most popular tags

Collection|Tag[]
fetPopularWhole(int $take = 15)

Returns most popular tags in whole

Collection|Tag[]
fetchPopularPeriod(DateTime|string $since, DateTime|string|null $until = null, string|null $instanceId = null, int $take = 15)

Returns most popular tags of date period

Collection|Tag[]
fetchPopularPeriodWhole(DateTime|string $since, DateTime|string|null $until = null, int $take = 15)

Returns most popular tags of date period in whole

Collection|Tag[]
fetchSimilar(string $decomposed, int $take = 15, string|null $instanceId = null)

Search similar tags by given string

DateTime|Carbon
getNow()

Returns Datetime instance for now

Details

Model update(Model $item, array $data = array())

update

Parameters

Model $item item
array $data data

Return Value

Model

bool|null delete(Model $item)

delete

Parameters

Model $item item

Return Value

bool|null

Exceptions

Exception

int increment(Model $item, string $column, int $amount = 1)

Increment a column's value by a given amount.

Parameters

Model $item item
string $column column
int $amount amount

Return Value

int

int decrement(Model $item, string $column, int $amount = 1)

Decrement a column's value by a given amount.

Parameters

Model $item item
string $column column
int $amount amount

Return Value

int

static string getModel()

The name of Category model class

Return Value

string

static void setModel(string $model)

Set the name of Category model

Parameters

string $model model class

Return Value

void

Model createModel()

Create model instance

Return Value

Model

Builder query()

query

Return Value

Builder

mixed __call(string $name, array $arguments)

__call

Parameters

string $name method name
array $arguments arguments

Return Value

mixed

at line 44
void attach(string $taggableId, Tag[] $tags)

Attach tag to taggable

Parameters

string $taggableId taggable id
Tag[] $tags tag instances

Return Value

void

at line 84
void detach(string $taggableId, Tag[] $tags)

Detach tag to taggable

Parameters

string $taggableId taggable id
Tag[] $tags tag instances

Return Value

void

at line 104
Collection|Tag[] fetchByTaggable(string $taggableId)

Returns tags of the taggable

Parameters

string $taggableId taggable id

Return Value

Collection|Tag[]

at line 123
Collection|Tag[] fetchPopular(string|null $instanceId = null, int $take = 15)

Returns most popular tags

Parameters

string|null $instanceId instance id
int $take take count

Return Value

Collection|Tag[]

at line 140
Collection|Tag[] fetPopularWhole(int $take = 15)

Returns most popular tags in whole

Parameters

int $take take count

Return Value

Collection|Tag[]

at line 154
Collection|Tag[] fetchPopularPeriod(DateTime|string $since, DateTime|string|null $until = null, string|null $instanceId = null, int $take = 15)

Returns most popular tags of date period

Parameters

DateTime|string $since begin date
DateTime|string|null $until end date
string|null $instanceId instance id
int $take take count

Return Value

Collection|Tag[]

at line 187
Collection|Tag[] fetchPopularPeriodWhole(DateTime|string $since, DateTime|string|null $until = null, int $take = 15)

Returns most popular tags of date period in whole

Parameters

DateTime|string $since begin date
DateTime|string|null $until end date
int $take take count

Return Value

Collection|Tag[]

at line 200
Collection|Tag[] fetchSimilar(string $decomposed, int $take = 15, string|null $instanceId = null)

Search similar tags by given string

Parameters

string $decomposed decomposed word
int $take take count
string|null $instanceId instance id of taggable

Return Value

Collection|Tag[]

at line 219
protected DateTime|Carbon getNow()

Returns Datetime instance for now

Return Value

DateTime|Carbon