Category

Implements \CategoryInterface

Class Category

This class represents a shop category which is not persisted yet.

category

System

package

Category

subpackage

Entities

Methods

Category constructor.

__construct(\CategorySettingsInterface $settings) 

Arguments

$settings

\CategorySettingsInterface

The category settings.

Adds a KeyValueCollection of addon values.

addAddonValues(\KeyValueCollection $collection) : \Category

Arguments

$collection

\KeyValueCollection

Key-Value collection.

Response

\Category

Same instance for chained method calls.

Deletes an addon value with a given key from the KeyValueCollection.

deleteAddonValue(\StringType $key) : \Category

Arguments

$key

\StringType

Identifier key.

Response

\Category

Same instance for chained method calls.

Returns the datetime when the category was added.

getAddedDateTime() : \DateTime

Response

\DateTime

Returns an addon value by a given key.

getAddonValue(\StringType $key) : string

Arguments

$key

\StringType

Identifier key.

Response

string

Returns a KeyValueCollection of addon values.

getAddonValues() : \KeyValueCollection

Returns the description of the category in the language with the provided language code.

getDescription(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Returns the bottom description of the category for the language with the provided language code.

getDescriptionBottom(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Description of the category from the given language code.

Returns the heading title of the category in the language with the provided language code.

getHeadingTitle(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Returns the icon filename of the category.

getIcon() : string

Response

string

Returns the image filename of the category.

getImage() : string

Response

string

Returns the alternative text of the image in the language with the provided language code.

getImageAltText(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Returns the datetime when the category was modified last.

getLastModifiedDateTime() : \DateTime

Response

\DateTime

Returns the meta title of the category in the language with the provided language code.

getMetaDescription(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Returns the meta keywords of the category in the language with the provided language code.

getMetaKeywords(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Returns the meta title of the category in the language with the provided language code.

getMetaTitle(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Returns the name of the category in the language with the provided language code.

getName(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Returns the OpenGraph image filename of the category.

getOpenGraphImage() : string

Response

string

Returns the ID of the parent category.

getParentId() : integer

Response

integer

The ID of the parent category

Returns the settings of the category.

getSettings() : \CategorySettingsInterface

Returns the sort order value.

getSortOrder() : integer

Response

integer

Sort order value.

Returns the url keywords of the category in the language with the provided language code.

getUrlKeywords(\LanguageCode $language) : string

Arguments

$language

\LanguageCode

Two letter language code.

Response

string

Get URL rewrite

getUrlRewrite(\LanguageCode $language) : \UrlRewrite

Returns the URL rewrite of the category, depending on the provided language code.

Throws
\InvalidArgumentException

if the language code is not valid.

Arguments

$language

\LanguageCode

The language code of the URL rewrite to be return.

Response

\UrlRewrite

The URL rewrite of the category.

Get URL rewrites

getUrlRewrites() : \UrlRewriteCollection

Returns the URL rewrites of the category.

Response

\UrlRewriteCollection

The URL rewrites of the category.

Checks if the category is active or not.

isActive() : boolean

Response

boolean

Sets whether category is active or not.

setActive(\BoolType $status) : \Category

Arguments

$status

\BoolType

Category active or not?

Response

\Category

Same instance for chained method calls.

Sets the datetime when the category was added.

setAddedDateTime(\DateTime $added) : \Category

Arguments

$added

\DateTime

Datetime of when the category has been added.

Response

\Category

Same instance for chained method calls.

Sets an addon key and value.

setAddonValue(\StringType $key, \StringType $value) : \Category

Arguments

$key

\StringType

Identifier key.

$value

\StringType

Value text.

Response

\Category

Same instance for chained method calls.

Sets the description of the category for the language with the provided language code.

setDescription(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

Description of the category.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Sets the bottom description of the category for the language with the provided language code.

setDescriptionBottom(\StringType $text, \LanguageCode $language) : \CategoryInterface

Arguments

$text

\StringType

Description of the category.

$language

\LanguageCode

Two letter language code.

Response

\CategoryInterface

Same instance for chained method calls.

Sets the heading title of the category for the language with the provided language code.

setHeadingTitle(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

Heading title of the category.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Sets the icon filename of the category.

setIcon(\StringType $iconFile) : \Category

Arguments

$iconFile

\StringType

Category icon file.

Response

\Category

Same instance for chained method calls.

Sets the image filename of the category.

setImage(\StringType $imageFile) : \Category

Arguments

$imageFile

\StringType

Category image file.

Response

\Category

Same instance for chained method calls.

Set the alternative text of the image for the language with the provided language code.

setImageAltText(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

Alternative text of the category image.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Sets the date time when the category was modified last.

setLastModifiedDateTime(\DateTime $modified) : \Category

Arguments

$modified

\DateTime

Datetime of when the category has been lastly modified.

Response

\Category

Same instance for chained method calls.

Sets the meta title of the category for the language with the provided language code.

setMetaDescription(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

Meta title of the category.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Sets the meta keywords of the category for the language with the provided language code.

setMetaKeywords(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

Meta keywords of the category.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Sets the meta title of the category for the language with the provided language code.

setMetaTitle(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

Meta title for the category.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Sets the name of the category for the language with the provided language code.

setName(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

Category name.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Sets the OpenGraph image filename of the category.

setOpenGraphImage(\StringType $imageFile) : \Category

Arguments

$imageFile

\StringType

Category image file.

Response

\Category

Same instance for chained method calls.

Sets the parent ID of the category.

setParentId(\IdType $categoryId) : \Category

Arguments

$categoryId

\IdType

The parent ID.

Response

\Category

Same instance for chained method calls.

Sets a category setting object

setSettings(\CategorySettingsInterface $settings) : \Category

Arguments

Response

\Category

Same instance for chained method calls.

Sets the sort order to the given value.

setSortOrder(\IntType $sortOrder) : \Category

Arguments

$sortOrder

\IntType

Order value.

Response

\Category

Same instance for chained method calls.

Sets the url keywords of the category for the language with the provided language code.

setUrlKeywords(\StringType $text, \LanguageCode $language) : \Category

Arguments

$text

\StringType

URL keywords of the category.

$language

\LanguageCode

Two letter language code.

Response

\Category

Same instance for chained method calls.

Set URL rewrite

setUrlRewrite(\UrlRewrite $urlRewrite, \LanguageCode $language) : \Category

Sets the URL rewrite of the category for the provided language code.

Arguments

$urlRewrite

\UrlRewrite

The URL rewrite instance.

$language

\LanguageCode

The language code for the URL keywords.

Response

\Category

Same instance for chained method calls.

Set URL rewrites

setUrlRewrites(\UrlRewriteCollection $urlRewrites) : \Category

Sets the URL rewrites of the category.

Arguments

$urlRewrites

\UrlRewriteCollection

The URL rewrites.

Response

\Category

Same instance for chained method calls.

Properties

Contains if category is active or not.

active : boolean
var

Type(s)

boolean

Parent ID of the Category.

parentId : integer
var

Type(s)

integer

Sort order value.

sortOrder : integer
var

Type(s)

integer

Date time when the category was added.

dateAdded : \DateTime
var

Type(s)

\DateTime

Date time when the category was modified last.

lastModified : \DateTime
var

Type(s)

\DateTime

Category settings.

settings : \CategorySettingsInterface

Names of the category.

names : array
var

Type(s)

array

Heading Titles of the category.

headingTitles : array
var

Type(s)

array

Description of the category.

descriptions : array
var

Type(s)

array

Bottom description of the category.

descriptions_bottom : array
var

Type(s)

array

Meta title of the category.

metaTitles : array
var

Type(s)

array

Meta description of the category.

metaDescriptions : array
var

Type(s)

array

Meta keywords of the category.

metaKeywords : array
var

Type(s)

array

Url keywords of the category.

urlKeywords : array
var

Type(s)

array

URL rewrites.

urlRewrites : \UrlRewriteCollection
var

Type(s)

\UrlRewriteCollection

Path to an image file.

image : string
var

Type(s)

string

Path to an OpenGraph image file.

openGraphImage : string
var

Type(s)

string

Alt texts of the image.

altTexts : array
var

Type(s)

array

Path to an icon file.

icon : string
var

Type(s)

string

Addon values.

addonValues : \EditableKeyValueCollection