PHP Class Sulu\Bundle\CategoryBundle\Controller\CategoryController

Inheritance: extends Sulu\Component\Rest\RestController, implements FOS\RestBundle\Routing\ClassResourceInterface, implements Sulu\Component\Security\SecuredControllerInterface, use trait Sulu\Component\Rest\RequestParametersTrait
Afficher le fichier Open project: sulu/sulu

Protected Properties

Свойство Type Description
$entityKey
$entityName

Méthodes publiques

Méthode Description
cgetAction ( Request $request ) : Response Returns the whole category graph.
deleteAction ( $id ) : Response Deletes the category which is assigned to the given id.
getAction ( $id, Request $request ) : Response Returns the category which is assigned to the given id.
getChildrenAction ( mixed $parentId, Request $request ) : Response Returns the sub-graph below the category which is assigned to the given parentId.
getFieldsAction ( Request $request ) : mixed Returns all fields that can be used by list.
getSecurityContext ( )
patchAction ( Request $request, $id ) : Response Partly updates the category which is assigned to the given id.
postAction ( Request $request ) : Response Adds a new category.
putAction ( $id, Request $request ) : Response Updates the category which is assigned to the given id.

Méthodes protégées

Méthode Description
getListRepresentation ( Request $request, $locale, null $parentId = null, array $expandIds = [] ) : CategoryListRepresentation Returns a category-list-representation for the category graph respective to the request.
saveCategory ( Request $request, null $id = null, boolean $patch = false ) : Response Creates or updates a category based on the request.

Private Methods

Méthode Description
getCategoryManager ( ) : Sulu\Bundle\CategoryBundle\Category\CategoryManagerInterface Returns the CategoryManager.
initializeListBuilder ( $locale ) : DoctrineListBuilder Initializes and returns a ListBuilder instance which is used when returning a CategoryListRepresentation for the given locale. The returned ListBuilder is initialized with the request-parameters and respective select fields.

Method Details

cgetAction() public méthode

If request.rootKey is set, only the sub-graph below the category which is assigned to the given key is returned. If request.flat is set, only the first level of the respective graph is returned in a flat format. If request.expand is set, the paths to the respective categories are expanded.
public cgetAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
Résultat Symfony\Component\HttpFoundation\Response

deleteAction() public méthode

Deletes the category which is assigned to the given id.
public deleteAction ( $id ) : Response
$id
Résultat Symfony\Component\HttpFoundation\Response

getAction() public méthode

Returns the category which is assigned to the given id.
public getAction ( $id, Request $request ) : Response
$id
$request Symfony\Component\HttpFoundation\Request
Résultat Symfony\Component\HttpFoundation\Response

getChildrenAction() public méthode

This method is used by the husky datagrid to load children of a category. If request.flat is set, only the first level of the respective graph is returned in a flat format.
public getChildrenAction ( mixed $parentId, Request $request ) : Response
$parentId mixed
$request Symfony\Component\HttpFoundation\Request
Résultat Symfony\Component\HttpFoundation\Response

getFieldsAction() public méthode

Returns all fields that can be used by list.
public getFieldsAction ( Request $request ) : mixed
$request Symfony\Component\HttpFoundation\Request
Résultat mixed

getListRepresentation() protected méthode

The category-list-representation contains only the root level of the category graph. If parentId is set, the root level of the sub-graph below the category with the given parentId is returned. If expandIds is set, the paths to the categories which are assigned to the ids are expanded.
protected getListRepresentation ( Request $request, $locale, null $parentId = null, array $expandIds = [] ) : CategoryListRepresentation
$request Symfony\Component\HttpFoundation\Request
$locale
$parentId null
$expandIds array
Résultat Sulu\Bundle\CategoryBundle\Category\CategoryListRepresentation

getSecurityContext() public méthode

public getSecurityContext ( )

patchAction() public méthode

Properties which are not set in the request will not be changed.
public patchAction ( Request $request, $id ) : Response
$request Symfony\Component\HttpFoundation\Request
$id
Résultat Symfony\Component\HttpFoundation\Response

postAction() public méthode

Adds a new category.
public postAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
Résultat Symfony\Component\HttpFoundation\Response

putAction() public méthode

Properties which are not set in the request will be removed from the category.
public putAction ( $id, Request $request ) : Response
$id
$request Symfony\Component\HttpFoundation\Request
Résultat Symfony\Component\HttpFoundation\Response

saveCategory() protected méthode

If id is set, the category which is assigned to the given id is overwritten. If patch is set, the category which is assigned to the given id is updated partially.
protected saveCategory ( Request $request, null $id = null, boolean $patch = false ) : Response
$request Symfony\Component\HttpFoundation\Request
$id null
$patch boolean
Résultat Symfony\Component\HttpFoundation\Response

Property Details

$entityKey protected_oe static_oe property

protected static $entityKey

$entityName protected_oe static_oe property

protected static $entityName