Category

Contracts

CategoryBranchMarketplaceRepositoryContract

Repository for CategoryBranchMarketplace

Namespace

Plenty\Modules\Category\Contracts

Methods

public findCategoryBranchMarketplace(int $branchId, int $webstoreId, int $marketplaceId, float $marketplaceSubId = 0.0):CategoryBranchMarketplace
Parameters
int $branchId
int $webstoreId
int $marketplaceId
float $marketplaceSubId

CategoryBranchRepositoryContract

Repository Contract for CategoryBranch

Namespace

Plenty\Modules\Category\Contracts

Methods

public find(int $id):CategoryBranch
Parameters
int $id
public get(int $page = 1, int $itemsPerPage = 50, array $filters = []):PaginationResponseContract

Get category trees

Parameters
int $page
int $itemsPerPage
array $filters Filters restrict the list of results. Results can be filtered by the following parameters: 'type' - the category type. Available values: item, container, content, blog
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.

CategoryRepositoryContract

Repository for categories

Namespace

Plenty\Modules\Category\Contracts

Methods

public get(int $categoryId, string $lang = "de"):Category

Returns one category by id.

Parameters
int $categoryId The id of the category.
string $lang Optional language of details.
public getLinklistTree(string $type = "all", string $lang = "de", int $clientId = null, int $maxLevel = 6):array

Returns all linklist categories as tree.

Parameters
string $type 'all','item','container','content' or 'blog'
string $lang Optional language of details.
int $clientId The unique ID of the client (store)
int $maxLevel The deepest category level to load
public buildCache(string $type = "all", string $lang = "de", int $clientId):void

Rebuild the category tree cache

Parameters
string $type 'all','item','container','content' or 'blog'
string $lang Optional language of details.
int $clientId The unique ID of the client (store)
public getLinklistList(string $type = "all", string $lang = "de", int $clientId = null, int $maxLevel = 6):array

Returns all linklist categories as list.

Parameters
string $type 'all','item','container','content' or 'blog'
string $lang Optional language of details.
int $clientId The unique ID of the client (store)
int $maxLevel The deepest category level to load
public hasChildren(int $categoryId, bool $onlySiteMapped = false, bool $onlyLinkListed = false):bool

Returns true if category has children.

Parameters
int $categoryId The id of the category.
bool $onlySiteMapped Determines if the result has only sitemaps or all visible categories.
bool $onlyLinkListed Determines if the result has only linklists or all visible categories.
public getChildren(int $categoryId, string $lang = "de"):array

Returns children of the category.

Parameters
int $categoryId The id of the category.
string $lang Optional language of details.
public getUrl(int $categoryId, string $lang = "de", bool $onlySitemaps = false):string

Retrieves the url for a category.

Parameters
int $categoryId The id of the category.
string $lang Optional language of details.
bool $onlySitemaps Whether or not to only include categories with 'sitemaps' = 'Y'. Default false.
public search(int $categoryId = null, int $page, int $itemsPerPage = 50, array $with = [], array $filters = []):PaginatedResult

Search for categories

Parameters
int $categoryId The id of the category.
int $page The requested page.
int $itemsPerPage Number of items per page.
array $with The relations to be loaded.
array $filters Filters restrict the list of results. Results can be filtered by the following parameters: 'type','lang','parentId', 'plentyId', 'linklist'
public createCategories(array $data):array

Creates new categories, including CategoryDetails. At least one CategoryDetails object for the default language is required. The data fields 'plentyId','lang' and 'name' are required. Client objects can also be specified to activate visibility for a client.

Parameters
array $data The data fields for the new Categories, including the details data fields
public updateCategories(array $data):array

Update categories, including optional CategoryDetails. The data fields 'plentyId','lang' are required for the CategoryDetails object. Client objects can also be specified to change visibility for a client.

Parameters
array $data The data fields for the Categories, including the details and client data fields
public createCategory(array $data):Category

Creates a new category

Parameters
array $data
public delete(int $categoryId):DeleteResponse

Deletes a category. The ID of the category must be specified.

Parameters
int $categoryId
public deleteCategoryDetails(int $categoryId, array $data):DeleteResponse

Delete the category details for the languages specified.

Parameters
int $categoryId
array $data
public deleteCategoryClients(int $categoryId, array $data):DeleteResponse

Deactivate availability for clients

Parameters
int $categoryId
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

Category

Category

Namespace

Plenty\Modules\Category\Models

Properties

Type Name Description
int id The unique ID of the category
int parentCategoryId The ID of the category's parent category. Value is null if category level is 1.
int level The category level of this category. This information is used for the sitemap.
string type The category type of the category
string linklist Flag that indicates if the category will be displayed in the online store's navigation.
string right Flag that indicates who can see this category.
  • all = Category is visible to all visitors of the online store.
  • customer = Category and all of its subcategories are visible to visitors of the online store that have logged in only. Visitors that are not logged in are redirected to the login page.
string sitemap Flag that indicates if the category will be included in the sitemap.
array clients Collection of the clients (stores) that belong to this category
array details Collection of the category details that belong to this category

Methods

public toArray()

Returns this model as an array.

CategoryBranch

Category Branch

Namespace

Plenty\Modules\Category\Models

Properties

Type Name Description
int categoryId The ID of the category
int category1Id The ID of the category tree's 1st level. If 1st value is identical to category ID, category is of this level.
int category2Id The ID of the category tree's 2nd level. If 2nd level value is identical to category ID, category is of this level. If 2nd level value is null, category is of a higher level.
int category3Id The ID of the category tree's 3rd level. If 3rd level value is identical to category ID, category is of this level. If 2nd level value is null, category is of a higher level.
int category4Id The ID of the category tree's 4th level. If 4th level value is identical to category ID, category is of this level. If 2nd level value is null, category is of a higher level.
int category5Id The ID of the category tree's 5th level. If 5th level value is identical to category ID, category is of this level. If 2nd level value is null, category is of a higher level.
int category6Id The ID of the category tree's 6th level. If 6th level value is identical to category ID, category is of this level. If 2nd level value is null, category is of a higher level.

Methods

public toArray()

Returns this model as an array.

CategoryBranchMarketplace

The CategoryBranchMarketplace model

Namespace

Plenty\Modules\Category\Models

Properties

Type Name Description
int plenty_category_branch_marketplace_branch_id
int plenty_category_branch_marketplace_webstore_id
float plenty_category_branch_marketplace_marketplace_id
float plenty_category_branch_marketplace_marketplace_sub_id
string plenty_category_branch_marketplace_delimiter
string plenty_category_branch_marketplace_value1
string plenty_category_branch_marketplace_value2
string plenty_category_branch_marketplace_last_update
CategoryBranch branch

Methods

public toArray()

Returns this model as an array.

CategoryClient

The Category Client

Namespace

Plenty\Modules\Category\Models

Properties

Type Name Description
int plentyId The unique plenty ID of the client (store) in which the category is visible. Several IDs can be separated by commas. If a subcategory is linked to a client, its parent categories will be linked to this client as well.

Methods

public toArray()

Returns this model as an array.

CategoryDetails

CategoryDetails

Namespace

Plenty\Modules\Category\Models

Properties

Type Name Description
int categoryId The unique ID of the category these category details belong to
int plentyId The unique plenty ID of the client (store) in which the category is visible. If a subcategory is linked to a client, its parent categories will be linked to this client as well.
string lang The language of the category
string name The name of the category. The same category name can be used more than once in different categories or on different category levels. However, category names must be unique within the same category or level.
string description The category text. The description is inserted into the online store using template variables.
string description2 The category text 2. The description 2 is inserted into the online store using template variables.
string shortDescription The short description of the category. The short description can be inserted into the store's design using template variables.
string metaKeywords HTML meta keywords to tag the category for search engines. More than one keyword can be separated by commas.
string metaDescription The meta description of the category. This description is analysed by search engines and displayed in search results. This text should be treated as an advertising text to maximise click-through from search engine result pages. Current recommended limit is 156 characters.
string nameUrl The category name to be used for the category's URL. The same URL name can be used more than once in different categories or on different category levels. However, URL names must be unique within the same category or level. The URL name should not be changed once the category is indexed by search engines. If no URL name is specified, the name will automatically be used as the URL name when the category is created.
Important: Name should contain ASCII code only and no special characters. The following character strings may not be used as prefixes to URL names: a-, b-, c-, f-, fa-, p-, t-. These prefixes will be removed automatically. For instance, a-class will be changed to class automatically. However, the URL name aclass can be used for a category named A-class.
string metaTitle This will be displayed as the title of a tab in the web browser and as a search result in search engines. If this is left blank, the category name will be used as the title. Current recommended limit is 50 characters. Longer titles will be cut off.
string image The ID to the image1 of the category.
string image2 The ID to the image2 of the category.
string imagePath The path to the image1 of the category.
string image2Path The path to the image2 of the category.
string previewUrl The category's URL.
int position The position of the category within a category level.
string itemListView The template the category is linked to for the category overview. The template determines what the category overview will look like for this category. This option is available for categories of the type Item only. Possible values: ItemViewCategoriesList, ItemViewCategoriesList2 to ItemViewCategoriesList10.
string singleItemView The template the category is linked to for the single item view. The template determines the appearance of the single item design for this category. This option is available for categories of the type Item only. Possible values: ItemViewSingleItem, ItemViewSingleItem2 to ItemViewSingleItem5.
string pageView
bool fulltext Flag that indicates if the complete category text, i.e. the complete description, will be searched.
  • Y = Complete text will be searched.
  • N = Text will not be searched completely.
string metaRobots Values from the meta element Robots are analyzed by Web crawlers. These values tell the crawler what it should do with the page and with the links on the page.
  • all = Include this category in the search engine index and follow the links on the page.
  • index = Include in the search engine index.
  • nofollow = Do not follow the links on the page.
  • noindex = Do not include in the search engine index.
  • nofollow, noindex = Do not follow the links and do not include the category in the search engine index.
string canonicalLink The URL of any category that contains the same content. This will avoid duplicate content.
string updatedAt The time the category details were last updated
string updatedBy The user who last updated the category details
Category category The category these category details are associated with.

Methods

public toArray()

Returns this model as an array.

CategoryItemCount

CategoryItemCount

Namespace

Plenty\Modules\Category\Models

Properties

Type Name Description
int categoryId The unique ID of the category
int webstoreId The ID of the client (store)
int count The count of items
string createdAt The date that the category item count was created.
string updatedAt The date that the category item count was updated last.

Methods

public toArray()

Returns this model as an array.

CategoryTemplate

Category Template

Namespace

Plenty\Modules\Category\Models

Properties

Type Name Description
int categoryId The unique ID of the category
int plentyId The unique plenty ID of the client (store)
string lang The language of the template
string content The content of the template

Methods

public toArray()

Returns this model as an array.