PHP Class Xpressengine\Tag\Tag

Author: XE Developers ([email protected])
Inheritance: extends Xpressengine\Database\Eloquent\DynamicModel
Show file Open project: xpressengine/xpressengine Class Usage Examples

Public Properties

Property Type Description
$timestamps boolean Indicates if the model should be timestamped.

Protected Properties

Property Type Description
$guarded array The attributes that aren't mass assignable.
$table string The table associated with the model.
$taggableTable string The table associated with the model for morph.

Public Methods

Method Description
getByTaggable ( string $taggableId ) : Illuminate\Database\Eloquent\Collection | static[] Returns tags of the taggable
getCount ( ) : integer Used count of model
getPopular ( string | null $instanceId = null, integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[] Returns most popular tags
getPopularPeriod ( DateTime | string $since, DateTime | string | null $until = null, string | null $instanceId = null, integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[] Returns most popular tags of date period
getPopularPeriodWhole ( DateTime | string $since, DateTime | string | null $until = null, integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[] Returns most popular tags of date period in whole
getPopularWhole ( integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[] Returns most popular tags in whole
getTaggableTable ( ) : string Returns table

Private Methods

Method Description
wherePeriod ( Builder $query, DateTime | string $since, DateTime | string | null $until = null ) : void Period query helper

Method Details

getByTaggable() public static method

Returns tags of the taggable
public static getByTaggable ( string $taggableId ) : Illuminate\Database\Eloquent\Collection | static[]
$taggableId string taggable id
return Illuminate\Database\Eloquent\Collection | static[]

getCount() public method

Used count of model
public getCount ( ) : integer
return integer

getPopular() public static method

Returns most popular tags
public static getPopular ( string | null $instanceId = null, integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[]
$instanceId string | null instance id
$take integer take count
return Illuminate\Database\Eloquent\Collection | static[]

getPopularPeriod() public static method

Returns most popular tags of date period
public static getPopularPeriod ( DateTime | string $since, DateTime | string | null $until = null, string | null $instanceId = null, integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[]
$since DateTime | string begin date
$until DateTime | string | null end date
$instanceId string | null instance id
$take integer take count
return Illuminate\Database\Eloquent\Collection | static[]

getPopularPeriodWhole() public static method

Returns most popular tags of date period in whole
public static getPopularPeriodWhole ( DateTime | string $since, DateTime | string | null $until = null, integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[]
$since DateTime | string begin date
$until DateTime | string | null end date
$take integer take count
return Illuminate\Database\Eloquent\Collection | static[]

getPopularWhole() public static method

Returns most popular tags in whole
public static getPopularWhole ( integer $take = 15 ) : Illuminate\Database\Eloquent\Collection | static[]
$take integer take count
return Illuminate\Database\Eloquent\Collection | static[]

getTaggableTable() public method

Returns table
public getTaggableTable ( ) : string
return string

Property Details

$guarded protected property

The attributes that aren't mass assignable.
protected array $guarded
return array

$table protected property

The table associated with the model.
protected string $table
return string

$taggableTable protected property

The table associated with the model for morph.
protected string $taggableTable
return string

$timestamps public property

Indicates if the model should be timestamped.
public bool $timestamps
return boolean