Tag

Contracts

TagAvailabilityRepositoryContract

Repository for TagAvailability

Namespace

Plenty\Modules\Tag\Contracts

Methods

public update(array $data, int $tagId, string $availabilityType):TagAvailability
Parameters
array $data The availability data. The properties that are required to update an tag can be found in the TagAvailability model.
int $tagId The tag ID
string $availabilityType The type of the availability. The following types are available.
  • blog
  • category
  • content_page
  • item
  • ticket
public create(array $data):TagAvailability
Parameters
array $data The availability data. The properties that are required to update an tag can be found in the TagAvailability model.
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

TagNameRepositoryContract

Repository for TagName

Namespace

Plenty\Modules\Tag\Contracts

Methods

public update(array $data, int $tagId, string $lang):TagName
Parameters
array $data The name data. The properties that are required to update an name can be found in the TagName model.
int $tagId The tag ID
string $lang The language of the name
public create(array $data):TagName
Parameters
array $data The name data. The properties that are required to update an name can be found in the TagName model.
public findByName(string $name, string $lang):array
Parameters
string $name The tag name
string $lang The language of the name
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

TagRelationshipRepositoryContract

Repository for TagRelationship

Namespace

Plenty\Modules\Tag\Contracts

Methods

public update(array $data, int $tagId, string $availabilityType, int $relationshipValue):TagRelationship
Parameters
array $data The relationship data. The properties that are required to update a relationship can be found in the TagRelationship model.
int $tagId The ID of the tag
string $availabilityType The type of the availability. The following types are available:
  • category
  • item
  • ticket
int $relationshipValue The value of the relationship. This value is the ID of the data set the tag is linked to, e.g. item ID 1234.
public create(array $data):TagRelationship
Parameters
array $data The relationship data. The properties that are required to update a relationship can be found in the TagRelationship model.
public deleteRelation(int $relationshipValue, int $tagId):void
Parameters
int $relationshipValue The value of the relationship. This value is the ID of the data set the tag is linked to, e.g. item ID 1234.
int $tagId The ID of the tag
public deleteOneRelation(int $relationshipValue, string $relationshipType, int $tagId):void
Parameters
int $relationshipValue The value of the relationship. This value is the ID of the data set the tag is linked to, e.g. item ID 1234.
string $relationshipType The type of the relationship, i.e. category, item or ticket
int $tagId The ID of the tag
public findByValueId(int $valueId):array
Parameters
int $valueId The value of the relationship. This value is the ID of the data set the tag is linked to, e.g. item ID 1234.
public findByTagId(int $tagId):array
Parameters
int $tagId The ID of the tag
public findRelationship(int $tagId, int $relationshipValue, string $relationshipType):TagRelationship

Gets a specific tag relationship or returns null

Parameters
int $tagId
int $relationshipValue
string $relationshipType
public delete(int $relationshipValue, string $relationshipType):DeleteResponse

Deletes tag links by reference value and relationship type

Parameters
int $relationshipValue
string $relationshipType
public listRelationships():Collection

Returns all tagRelationships

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

TagRepositoryContract

The TagRepositoryContract is the interface for the tag repository.

Namespace

Plenty\Modules\Tag\Contracts

Methods

public create(string $name):Tag

Create a new tag.

Parameters
string $name The tag name
public update(array $data, int $tagId):Tag

Update a tag.

Parameters
array $data The tag data. The properties that are required to update an tag can be found in the Tag model.
int $tagId The tag ID
public delete(int $tagId):void

Deletes a tag by given tagId

Parameters
int $tagId The tag ID
public getTagByName(string $name):Tag
Parameters
string $name The name of the tag
public getTagsByIds(array $ids):array
Parameters
array $ids The IDs of the tags
public getTagById(int $id):Tag
Parameters
int $id
public getTagsByAvailability(string $availabilityType):array
Parameters
string $availabilityType The type of the availability. The following types are available.
  • blog
  • category
  • content_page
  • item
  • ticket
public listTags():Collection

Returns all tags

public createTag(array $data):Tag

Creates a new tag

Parameters
array $data
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

Models

Tag

The Tag model.

Namespace

Plenty\Modules\Tag\Models

Properties

Type Name Description
int id The tag ID
string tagName The name of the tag
array availabilities The availabilities of the tag.
array names The names of the tag.
array relationships The relationships of the tag.

Methods

public toArray()

Returns this model as an array.

TagAvailability

The tag availability model.

Namespace

Plenty\Modules\Tag\Models

Properties

Type Name Description
int tagId The Tag ID of the tag
string tagType The type of the tag. The following types are available.
  • blog
  • category
  • content_page
  • item
  • ticket

Methods

public toArray()

Returns this model as an array.

TagName

The tag name model.

Namespace

Plenty\Modules\Tag\Models

Properties

Type Name Description
int id The name ID of the tag
int tagId The tag ID
string tagLang The lang of the tag name.
string tagName The name of the tag.

Methods

public toArray()

Returns this model as an array.

TagRelationship

The tag relationship model.

Namespace

Plenty\Modules\Tag\Models

Properties

Type Name Description
int tagId The Tag ID of the tag
string tagType The type of the tag. The following types are available.
  • blog
  • category
  • content_page
  • item
  • ticket
int relationshipValue The identifying value for what the tag is in relation to

Methods

public toArray()

Returns this model as an array.