Plentymarkets interface documentation

Tag

Contracts

TagAvailabilityRepositoryContract

The TagAvailabilityRepositoryContract is the interface for the tag availability repository. This interface allows to update and create tag availabilities.

Namespace

Plenty\Modules\Tag\Contracts

Methods
public update($data, $tagId, $availabilityType):Plenty\Modules\Tag\Models\TagAvailability
Return type: TagAvailability
Parameters

Name

Type

Description

$data

array

The availability data. The properties that are required to update an tag can be found in the TagAvailability model.

$tagId

int

The ID of the tag

$availabilityType

string

The type of the availability. The following types are available. <ul> <li>blog</li> <li>category</li> <li>content_page</li> <li>variation</li> <li>ticket</li> </ul>

public create($data):Plenty\Modules\Tag\Models\TagAvailability
Return type: TagAvailability
Parameters

Name

Type

Description

$data

array

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

The TagNameRepositoryContract is the interface for the tag name repository. This interface allows to update, create and list tag names.

Namespace

Plenty\Modules\Tag\Contracts

Methods
public update($data, $tagId, $lang):Plenty\Modules\Tag\Models\TagName
Return type: TagName
Parameters

Name

Type

Description

$data

array

The name data. The properties that are required to update an name can be found in the TagName model.

$tagId

int

The ID of the tag

$lang

string

The language of the name

public create($data):Plenty\Modules\Tag\Models\TagName
Return type: TagName
Parameters

Name

Type

Description

$data

array

The name data. The properties that are required to update an name can be found in the TagName model.

public findByName($name, $lang):array
Parameters

Name

Type

Description

$name

string

The name of the tag

$lang

string

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

The TagRelationshipRepositoryContract is the interface for the tag relationship repository. This interface allows to update, create, delete and list tag relationships.

Namespace

Plenty\Modules\Tag\Contracts

Methods
public update($data, $tagId, $availabilityType, $relationshipValue):Plenty\Modules\Tag\Models\TagRelationship
Return type: TagRelationship
Parameters

Name

Type

Description

$data

array

The relationship data. The properties that are required to update a relationship can be found in the TagRelationship model.

$tagId

int

The ID of the tag

$availabilityType

string

The type of the availability. The following types are available: <ul> <li>category</li> <li>variation</li> <li>ticket</li> </ul>

$relationshipValue

int

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($data):Plenty\Modules\Tag\Models\TagRelationship
Return type: TagRelationship
Parameters

Name

Type

Description

$data

array

The relationship data. The properties that are required to update a relationship can be found in the TagRelationship model.

public deleteRelation($relationshipValue, $tagId):void
Parameters

Name

Type

Description

$relationshipValue

int

The value of the relationship. This value is the ID of the data set the tag is linked to, e.g. item ID 1234.

$tagId

int

The ID of the tag

public deleteOneRelation($relationshipValue, $relationshipType, $tagId):void
Parameters

Name

Type

Description

$relationshipValue

int

The value of the relationship. This value is the ID of the data set the tag is linked to, e.g. item ID 1234.

$relationshipType

string

The type of the relationship, i.e. <b>category</b>, <b>item</b> or <b>ticket</b>

$tagId

int

The ID of the tag

public deleteOneRelationByUUID($relationshipUUID, $relationshipType, $tagId):int

Delete a tag relationship by the uuid5 value.

Parameters

Name

Type

Description

$relationshipUUID

string

The uuid5 value of the relationship.

$relationshipType

string

The type of the relationship, i.e. <b>board</b>

$tagId

int

The ID of the tag

public findByValueId($valueId):array
Parameters

Name

Type

Description

$valueId

int

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($tagId):array
Parameters

Name

Type

Description

$tagId

int

The ID of the tag

public findRelationship($tagId, $relationshipValue, $relationshipType):Plenty\Modules\Tag\Models\TagRelationship
Return type: TagRelationship

Gets a specific tag relationship or returns null.

Parameters

Name

Type

Description

$tagId

int

The ID of the tag

$relationshipValue

int

The value of the relationship

$relationshipType

string

The type of the relationship

public delete($relationshipValue, $relationshipType):Plenty\Repositories\Models\DeleteResponse
Return type: DeleteResponse

Deletes tag links by reference value and relationship type.

Parameters

Name

Type

Description

$relationshipValue

int

The value of the relationship

$relationshipType

string

The type of the relationship

public deleteByUUID($relationshipValue, $relationshipType):Plenty\Repositories\Models\DeleteResponse
Return type: DeleteResponse

Deletes tag links by uuid5 reference value and relationship type.

Parameters

Name

Type

Description

$relationshipValue

string

The value of the relationship

$relationshipType

string

The type of the relationship

public deleteBulk($data):Illuminate\Support\Collection
Return type: Collection

Deletes a list of tag relationships. The tag ID, tag type and relation value must be specified.

Parameters

Name

Type

Description

$data

array

The array containing the data.

public listRelationships($with = []):Illuminate\Support\Collection
Return type: Collection

Returns all tag relationships.

Parameters

Name

Type

Description

$with

array

An array with child instances to be loaded

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($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

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. This interface allows to create, update and delete tags.

Namespace

Plenty\Modules\Tag\Contracts

Methods
public create($name):Plenty\Modules\Tag\Models\Tag
Return type: Tag

Creates a new tag.

Parameters

Name

Type

Description

$name

string

The name of the tag

public update($data, $tagId):Plenty\Modules\Tag\Models\Tag
Return type: Tag

Updates a tag.

Parameters

Name

Type

Description

$data

array

The tag data. The properties that are required to update a tag can be found in the Tag model.

$tagId

int

The ID of the tag

public delete($tagId):void

Deletes a tag by the given tag ID.

Parameters

Name

Type

Description

$tagId

int

The ID of the tag

public getTagByName($name):Plenty\Modules\Tag\Models\Tag
Return type: Tag
Parameters

Name

Type

Description

$name

string

The name of the tag

public getTagsByIds($ids):array
Parameters

Name

Type

Description

$ids

array

The IDs of the tags

public getTagById($id, $with = []):Plenty\Modules\Tag\Models\Tag
Return type: Tag
Parameters

Name

Type

Description

$id

int

The ID of the tag

$with

array

An array with child instances to be loaded

public getTagsByAvailability($availabilityType):array
Parameters

Name

Type

Description

$availabilityType

string

The type of the availability. The following types are available. <ul> <li>blog</li> <li>category</li> <li>content_page</li> <li>variation</li> <li>ticket</li> <li>board</li> </ul>

public getTagsByRelationship($relationshipType, $value, $isUUID = false):array
Parameters

Name

Type

Description

$relationshipType

string

The relationship type

$value

The relationship value (string if UUID, otherwise int)

$isUUID

bool

Indicates whether the value is a UUID5 or not.

public listTags($with = []):Illuminate\Support\Collection
Return type: Collection

Returns all tags.

Parameters

Name

Type

Description

$with

array

An array with child instances to be loaded

public createTag($data):Plenty\Modules\Tag\Models\Tag
Return type: Tag

Creates a new tag.

Parameters

Name

Type

Description

$data

array

The data as associative array

public createBulk($data):array

Creates up to 50 new tags.

Parameters

Name

Type

Description

$data

array

The data as associative array

public updateBulk($data):array

Updates up to 50 tags.

Parameters

Name

Type

Description

$data

array

The data as associative array

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($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

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
Name Type Description

id

int

The tag ID

tagName

string

The name of the tag

color

string

The color for the tag

availabilities

array

The availabilities of the tag.

names

array

The names of the tag.

relationships

array

The relationships of the tag.

clients

array

The clients of the tag.

updatedAt

string

The updated at timestamp of the tag.

createdAt

string

The created at timestamp of the tag.

Methods
public toArray()

Returns this model as an array.

TagAvailability

The tag availability model.

Namespace

Plenty\Modules\Tag\Models

Properties
Name Type Description

tagId

int

The Tag ID of the tag

tagType

string

The type of the tag. The following types are available. <ul> <li>blog</li> <li>category</li> <li>content_page</li> <li>variation</li> <li>ticket</li> <li>board</li> <li>order</li> </ul>

Methods
public toArray()

Returns this model as an array.

TagClient

The tag client model.

Namespace

Plenty\Modules\Tag\Models

Properties
Name Type Description

id

int

The id of the relation

tagId

int

The Tag ID of the tag

plentyId

int

The PlentyId of the client

Methods
public toArray()

Returns this model as an array.

TagName

The tag name model.

Namespace

Plenty\Modules\Tag\Models

Properties
Name Type Description

id

int

The name ID of the tag

tagId

int

The tag ID

tagLang

string

The lang of the tag name.

tagName

string

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
Name Type Description

tagId

int

The ID of the tag

tagType

string

The type of tag.

relationshipValue

int

The ID of the data record for which a tag relationship is created

relationshipUUID5

string

The ID of the data record for which a tag relationship is created. For models with uuid5 as primary key

Methods
public toArray()

Returns this model as an array.