@param Action $action

@return DataGrid
330382
public function getDataGrid(Action $action): DataGrid
    {
        return $this->dataGridRegistry->getDataGrid($this->getDataGridConfigCode($action));
    }
491559
protected function action($action)
    {
        $action = in_array($action, $this->actions) ? $action : null;
        $action = array_key_exists($action, $this->aliases) ? $this->aliases[$action] : $action;

        return $action;
    }
541573
public function Link($action = null)
    {
        if ($this->currentRecord) {
            return Controller::join_links($this->parentController->Link(), "/{$this->currentRecord->ID}/{$action}");
        } else {
            return $this->parentController->Link();
        }

    }
744264
public function perPage(string $action = null): string
    {
        return $this->htmlRenderer->perPage($this->request, $action);
    }
821589
public function setAction($action)
    {
        foreach ($this->routes as $route)
            $route->setAction($action);
        return $this;
    }
857734
public static function initData($syncid, $action)
	{
		if ($syncid) {
			//clear sync in progress catch in case we manually stopped the sync so that the sync will continue
			self::changeStatus($syncid, 0);
		}

		$syncdata = new Registry();

		$syncdata->set('completed', false);
		$syncdata->set('sync_errors', 0);
		$syncdata->set('total_to_sync', 0);
		$syncdata->set('synced_users', 0);
		$syncdata->set('userbatch', 1);
		$syncdata->set('user_offset', 0);
		$syncdata->set('syncid', $syncid);
		$syncdata->set('action', $action);

		return $syncdata;
	}
643532
public function getDataGridConfigCode(Action $action, FamilyInterface $family): string
    {
        $familiesOptions = $action->getAdmin()->getOption('families', []);
        if (isset($familiesOptions[$family->getCode()]['datagrid'])) {
            return $familiesOptions[$family->getCode()]['datagrid'];
        }

        // Check if datagrid code is set in options
        $dataGridCode = $action->getOption(
            'datagrid',
            $action->getAdmin()->getOption('datagrid')
        );
        if (null !== $dataGridCode) {
            return $dataGridCode;
        }

        // Check if a datagrid corresponding to the current family exists
        foreach ([$family->getCode(), strtolower($family->getCode())] as $dataGridCode) {
            if ($this->dataGridRegistry->hasDataGrid($dataGridCode)) {
                return $dataGridCode;
            }
        }

        return $action->getAdmin()->getCode(); // Fallback to admin code
    }
1017714
protected function createModal($action)
    {
        $modal = new Modal(sprintf('%s.header.%s', $this->config->getId(), $action));

        $buttons = [];

        if (in_array($action, ['new', 'edit', 'remove'])) {
            $submitButton = [
                'id'       => 'submit',
                'label'    => 'ekyna_core.button.save',
                'icon'     => 'glyphicon glyphicon-ok',
                'cssClass' => 'btn-success',
                'autospin' => true,
            ];
            if ($action === 'edit') {
                $submitButton['icon'] = 'glyphicon glyphicon-ok';
                $submitButton['cssClass'] = 'btn-warning';
            } elseif ($action === 'remove') {
                $submitButton['label'] = 'ekyna_core.button.remove';
                $submitButton['icon'] = 'glyphicon glyphicon-trash';
                $submitButton['cssClass'] = 'btn-danger';
            }
            $buttons[] = $submitButton;
        }

        $buttons[] = [
            'id' => 'close',
            'label' => 'ekyna_core.button.cancel',
            'icon' => 'glyphicon glyphicon-remove',
            'cssClass' => 'btn-default',
        ];

        $modal->setButtons($buttons);

        return $modal;
    }
786104
public function filter($action = 'set') {
        $role = $this->Roles->newEntity();
        if ($this->request->session()->check('Roles')) {
            $session = $this->request->session()->read('Roles');
            $role = $this->Roles->patchEntity($role,  $session);
        }
        if ($this->request->is(['patch', 'post', 'put'])) {
            if ($action == 'unset') {
                $this->request->session()->delete('Roles');
            } else {
                $this->request->session()->write('Roles', $this->request->data);
            }
            $this->Flash->success(__('The role has been saved.'));
            return $this->redirect(['action' => 'index']);
        }
        $this->set(compact('role'));
        $this->set('_serialize', ['role']);
    }
784200
public function setAdapterAction($action)
    {
        if (true===$this->isInited) {
            $this->resetOutput();
        }
        $this->__adapter_action = $action;
        return $this;
    }
988214
public function make($name):DataGrid
    {
        $dataGrid = new DataGrid($this->request);
        $this->collection->put($name, $dataGrid);

        return $dataGrid;
    }
225225
protected function definingClassForAction($action)
    {
        $definingClass = parent::definingClassForAction($action);
        if ($definingClass) {
            return $definingClass;
        }

        $class = static::class;
        while ($class != 'SilverStripe\\Control\\RequestHandler') {
            $templateName = strtok($class, '_') . '_' . $action;
            if (SSViewer::hasTemplate($templateName)) {
                return $class;
            }

            $class = get_parent_class($class);
        }

        return null;
    }
774635
public function setAction($action)
    {
        $allowedValues = $this->getActionAllowableValues();
        if (!in_array($action, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'action', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['action'] = $action;

        return $this;
    }
328192
protected function renderAction(array $parameters = [], Action $action = null)
    {
        $response = new Response();
        $response->setContent($this->getTemplate($action)->render($parameters));

        return $response;
    }
786882
public function dispatchTo($action)
    {
        $this->setAction($action);

        $this->hook->action(
            'init',
            [$this, 'hooks']
        )->dispatch();

        return $this;
    }
1284797
public function bindDataGridRequest(
        Action $action,
        Request $request,
        DataGrid $dataGrid = null,
        array $formOptions = []
    ): DataGrid {
        $dataGrid = $this->buildDataGridForm($action, $request, $dataGrid, $formOptions);
        $dataGrid->handleRequest($request);

        return $dataGrid;
    }
636858
protected function getCollectionFromSession(Action $action, EnvironmentInterface $environment)
    {
        $inputProvider  = $environment->getInputProvider();
        $sessionStorage = $environment->getSessionStorage();
        $dataDefinition = $environment->getDataDefinition();
        $dataProvider   = $environment->getDataProvider($dataDefinition->getName());

        $addEditProperties =
            $inputProvider->hasValue('FORM_INPUTS')
            && ($dataDefinition->getName() === $inputProvider->getValue('FORM_SUBMIT'));

        $session = $this->getSession($action, $environment);

        $editProperties = [];

        $modelIds = [];
        foreach ($session['models'] as $modelId) {
            $modelIds[] = ModelId::fromSerialized($modelId)->getId();

            if ($addEditProperties) {
                $modelEditProperties = $inputProvider->getValue(\str_replace('::', '____', $modelId) . '_', true);
                $inputProvider->unsetValue(\str_replace('::', '____', $modelId) . '_');

                $editProperties[$modelId] = $modelEditProperties;
            }
        }

        $idProperty = \method_exists($dataProvider, 'getIdProperty') ? $dataProvider->getIdProperty() : 'id';
        $collection = $dataProvider->fetchAll(
            $dataProvider->getEmptyConfig()->setFilter(
                [['operation' => 'IN', 'property' => $idProperty, 'values' => $modelIds]]
            )
        );

        $session['editProperties'] = $editProperties;

        $sessionStorage->set($dataDefinition->getName() . '.' . $this->getMode($action), $session);

        return $collection;
    }