# \Thelia\ActionCategory

## Summary

Methods
Properties
Constants
create()
modify()
delete()
toggleVisibility()
changePositionUp()
changePositionDown()
changePosition()
getSubscribedEvents()
__construct()
getDispatcher()
No public properties found
No constants found
exchangePosition()
validateForm()
propagateFormError()
$container
N/A
No private methods found
No private properties found
N/A

File
  Action/Category.php
Package
  \Default
Class hierarchy
  \Thelia\Action\BaseAction
  \Thelia\Action\Category

## Tags

None found

## Properties

### $container

    $container : \Thelia\Action\The

#### Type

\Thelia\Action\The — container

#

Inherited from
  \Thelia\Action\BaseAction

## Tags

None found

## Methods

### create()

    create(\Thelia\Core\Event\ActionEvent $event)

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |

#

## Tags

None found

### modify()

    modify(\Thelia\Core\Event\ActionEvent $event)

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |

#

## Tags

None found

### delete()

    delete(\Thelia\Core\Event\ActionEvent $event)

Delete a category

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |

#

## Tags

None found

### toggleVisibility()

    toggleVisibility(\Thelia\Core\Event\ActionEvent $event)

Toggle category visibility. No form used here

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |

#

## Tags

None found

### changePositionUp()

    changePositionUp(\Thelia\Core\Event\ActionEvent $event)

Move category up

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |

#

## Tags

None found

### changePositionDown()

    changePositionDown(\Thelia\Core\Event\ActionEvent $event)

Move category down

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |

#

## Tags

None found

### changePosition()

    changePosition(\Thelia\Core\Event\ActionEvent $event)

Changes category position

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |

#

## Tags

None found

### getSubscribedEvents()

    getSubscribedEvents() : array

Returns an array of event names this subscriber listens to.

The array keys are event names and the value can be:

- The method name to call (priority defaults to 0)
- An array composed of the method name to call and the priority
- An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

- array('eventName' => 'methodName')
- array('eventName' => array('methodName', $priority))
- array('eventName' => array(array('methodName1', $priority), array('methodName2'))

#### Returns

array —

The event names to listen to

#

static

## Tags

api |

### __construct()

    __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container)

#### Parameters

\Symfony\Component\DependencyInjection\ContainerInterface | $container |

#

Inherited from
  \Thelia\Action\BaseAction

## Tags

None found

### getDispatcher()

    getDispatcher() : \Symfony\Component\EventDispatcher\EventDispatcherInterface

Return the event dispatcher,

#### Returns

\Symfony\Component\EventDispatcher\EventDispatcherInterface

#

Inherited from
  \Thelia\Action\BaseAction

## Tags

None found

### exchangePosition()

    exchangePosition(\Thelia\Core\Event\ActionEvent $event, string $direction)

Move up or down a category

#### Parameters

\Thelia\Core\Event\ActionEvent | $event |
string | $direction | up to move up, down to move down

#

## Tags

None found

### validateForm()

    validateForm(\Thelia\Form\BaseForm $aBaseForm, string $expectedMethod) : \Symfony\Component\Form\Form

Validate a BaseForm

#### Parameters

\Thelia\Form\BaseForm | $aBaseForm | the form
string | $expectedMethod | the expected method, POST or GET, or null for any of them

#### Throws

\Thelia\Action\Exception\FormValidationException

  is the form contains error, or the method is not the right one

#### Returns

\Symfony\Component\Form\Form —

Form the symfony form object

#

Inherited from
  \Thelia\Action\BaseAction

## Tags

None found

### propagateFormError()

    propagateFormError(\Thelia\Form\BaseForm $aBaseForm, string $error_message, \Thelia\Core\Event\ActionEvent $event)

Propagate a form error in the action event

#### Parameters

\Thelia\Form\BaseForm | $aBaseForm | the form
string | $error_message | an error message that may be displayed to the customer
\Thelia\Core\Event\ActionEvent | $event | the action event

#

Inherited from
  \Thelia\Action\BaseAction

## Tags

None found

### Category.php