PHP Класс Sulu\Bundle\CategoryBundle\Controller\CategoryController

Наследование: extends Sulu\Component\Rest\RestController, implements FOS\RestBundle\Routing\ClassResourceInterface, implements Sulu\Component\Security\SecuredControllerInterface, use trait Sulu\Component\Rest\RequestParametersTrait
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$entityKey
$entityName

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

cgetAction() публичный Метод

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
Результат Symfony\Component\HttpFoundation\Response

deleteAction() публичный Метод

Deletes the category which is assigned to the given id.
public deleteAction ( $id ) : Response
$id
Результат Symfony\Component\HttpFoundation\Response

getAction() публичный Метод

Returns the category which is assigned to the given id.
public getAction ( $id, Request $request ) : Response
$id
$request Symfony\Component\HttpFoundation\Request
Результат Symfony\Component\HttpFoundation\Response

getChildrenAction() публичный Метод

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
Результат Symfony\Component\HttpFoundation\Response

getFieldsAction() публичный Метод

Returns all fields that can be used by list.
public getFieldsAction ( Request $request ) : mixed
$request Symfony\Component\HttpFoundation\Request
Результат mixed

getListRepresentation() защищенный Метод

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
Результат Sulu\Bundle\CategoryBundle\Category\CategoryListRepresentation

getSecurityContext() публичный Метод

public getSecurityContext ( )

patchAction() публичный Метод

Properties which are not set in the request will not be changed.
public patchAction ( Request $request, $id ) : Response
$request Symfony\Component\HttpFoundation\Request
$id
Результат Symfony\Component\HttpFoundation\Response

postAction() публичный Метод

Adds a new category.
public postAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
Результат Symfony\Component\HttpFoundation\Response

putAction() публичный Метод

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
Результат Symfony\Component\HttpFoundation\Response

saveCategory() защищенный Метод

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
Результат Symfony\Component\HttpFoundation\Response

Описание свойств

$entityKey защищенное статическое свойство

protected static $entityKey

$entityName защищенное статическое свойство

protected static $entityName