Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 912 Bytes

group_action.md

File metadata and controls

38 lines (29 loc) · 912 Bytes

Create a Group Action

A "group action" is a Symfony service that will do any work you want. It will run a sequence of intructions on a dataset.

Create the GroupAction class

First you need to create a GroupAction class that extends AbstractGroupAction. You have to implement the execute method.

<?php

namespace My\Namespace;

use IDCI\Bundle\GroupActionBundle\Action\AbstractGroupAction;

class MyGroupAction extends AbstractGroupAction
{
    /**
     * {@inheritDoc}
     */
     public function execute(array $data)
     {
        // Your business logic with the given datasets.
     }
}

Register your class as a tagged service

acme.group_action.my_group_action:
    class: My\Namespace\MyGroupAction
    tags:
        - { name: idci.group_action, alias: my_group_action }