PHP Class Sulu\Bundle\CategoryBundle\Api\Category

Inheritance: extends Sulu\Bundle\CoreBundle\Entity\ApiEntityWrapper
Exibir arquivo Open project: sulu/sulu Class Usage Examples

Public Methods

Method Description
__construct ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface $category, $locale )
getChanged ( ) : string Returns the created date for the category.
getChanger ( ) : string Returns the changer of the category.
getChildren ( ) : Category[] Returns the children of a category.
getCreated ( ) : string Returns the created date for the category.
getCreator ( ) : string Returns the creator of the category.
getDefaultLocale ( ) : string Returns the default locale of the category.
getDescription ( ) : string Returns the description of the Category dependent on the locale.
getId ( ) : array Returns the id of the category.
getKey ( ) : string Returns the key of the category.
getLocale ( ) : string Returns the locale of the Category dependent on the existing translations and default locale.
getMedias ( ) : Media[] Returns the medias of the Category dependent on the locale.
getMediasRawData ( ) : string Returns the medias of the Category dependent on the locale.
getMeta ( ) : array Returns the name of the Category dependent on the locale.
getName ( ) : string Returns the name of the Category dependent on the locale.
getParent ( ) : null | Category Returns a parent category if one exists.
getParentId ( ) : null | Category Returns a the id of the parent category, if one exists.
setKey ( string $key ) : Category Sets the key of the category.
setMeta ( Sulu\Bundle\CategoryBundle\Entity\CategoryMetaInterface[] $metaEntities ) : Category Takes meta as array and sets it to the entity.
setParent ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface $parent ) : Category Sets a given category as the parent of the entity.
setTranslation ( Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface $translation ) Sets a translation to the entity.
toArray ( ) : array Returns an array representation of the object.

Private Methods

Method Description
getSingleMetaById ( $meta, $id ) : CollectionMeta Takes an array of CollectionMeta and returns a single meta for a given id.
getTranslation ( $withDefault = false ) : Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface Returns the translation with the current locale.
getTranslationByLocale ( string $locale ) : Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface Returns the translation with the given locale.
getUserFullName ( $user ) : string Takes a user entity and returns the fullname.

Method Details

__construct() public method

public __construct ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface $category, $locale )
$category Sulu\Bundle\CategoryBundle\Entity\CategoryInterface

getChanged() public method

Returns the created date for the category.
public getChanged ( ) : string
return string

getChanger() public method

Returns the changer of the category.
public getChanger ( ) : string
return string

getChildren() public method

Returns the children of a category.
public getChildren ( ) : Category[]
return Category[]

getCreated() public method

Returns the created date for the category.
public getCreated ( ) : string
return string

getCreator() public method

Returns the creator of the category.
public getCreator ( ) : string
return string

getDefaultLocale() public method

Returns the default locale of the category.
public getDefaultLocale ( ) : string
return string

getDescription() public method

Returns the description of the Category dependent on the locale.
public getDescription ( ) : string
return string

getId() public method

Returns the id of the category.
public getId ( ) : array
return array

getKey() public method

Returns the key of the category.
public getKey ( ) : string
return string

getLocale() public method

Returns the locale of the Category dependent on the existing translations and default locale.
public getLocale ( ) : string
return string

getMedias() public method

Returns the medias of the Category dependent on the locale.
public getMedias ( ) : Media[]
return Sulu\Bundle\MediaBundle\Api\Media[]

getMediasRawData() public method

Returns the medias of the Category dependent on the locale.
public getMediasRawData ( ) : string
return string

getMeta() public method

Returns the name of the Category dependent on the locale.
public getMeta ( ) : array
return array

getName() public method

Returns the name of the Category dependent on the locale.
public getName ( ) : string
return string

getParent() public method

Returns a parent category if one exists.
public getParent ( ) : null | Category
return null | Category

getParentId() public method

This method is used to serialize the parent-id.
public getParentId ( ) : null | Category
return null | Category

setKey() public method

Sets the key of the category.
public setKey ( string $key ) : Category
$key string
return Category

setMeta() public method

Takes meta as array and sets it to the entity.
public setMeta ( Sulu\Bundle\CategoryBundle\Entity\CategoryMetaInterface[] $metaEntities ) : Category
$metaEntities Sulu\Bundle\CategoryBundle\Entity\CategoryMetaInterface[]
return Category

setParent() public method

Sets a given category as the parent of the entity.
public setParent ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface $parent ) : Category
$parent Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
return Category

setTranslation() public method

If no other translation was assigned before, the translation is added as default.
public setTranslation ( Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface $translation )
$translation Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface

toArray() public method

Returns an array representation of the object.
public toArray ( ) : array
return array