Get all the workflow action instances for an item

@return DataList|null
6176
public function getWorkflowHistoryFor($item, $limit = null)
    {
        if ($active = $this->getWorkflowFor($item, true)) {
            $limit = $limit ? "0,$limit" : '';
            return $active->Actions('', 'ID DESC ', null, $limit);
        }
    }
95167
public function getRunWorkflowParam()
    {
        if (null === $this->runWorkflowParam) {
            $errMsg = 'runWorkflowParam not found';
            throw new Exception\WorkflowDispatchEventException($errMsg);
        }
        return $this->runWorkflowParam;
    }
101298
public function getList()
    {
        $objects = $this->manager->findAll();
        $this->addPaginationData($objects);
        $objects = $objects->getItems();
        if (empty($objects)) {
            $this->addInfoMessage(self::INFO_NO_ENTRIES_FOUND);
        }
        return $objects;
    }
1143970
public function dataFromObject()
    {
        $proto = $this->proto();
        $objMetadata = $proto->metadata();
        $adminMetadata = (isset($objMetadata['admin']) ? $objMetadata['admin'] : null);

        if (empty($adminMetadata['lists'])) {
            return [];
        }

        $collectionIdent = $this->collectionIdent();
        if (!$collectionIdent) {
            $collectionIdent = $this->collectionIdentFallback();
        }

        if ($collectionIdent && $proto->view()) {
            $collectionIdent = $proto->render($collectionIdent);
        }

        if (!$collectionIdent) {
            return [];
        }

        if (isset($adminMetadata['lists'][$collectionIdent])) {
            $objListData = $adminMetadata['lists'][$collectionIdent];
        } else {
            $objListData = [];
        }

        $collectionConfig = [];

        if (isset($objListData['list_actions']) && isset($adminMetadata['list_actions'])) {
            $extraListActions = array_intersect(
                array_keys($adminMetadata['list_actions']),
                array_keys($objListData['list_actions'])
            );
            foreach ($extraListActions as $listIdent) {
                $objListData['list_actions'][$listIdent] = array_replace_recursive(
                    $adminMetadata['list_actions'][$listIdent],
                    $objListData['list_actions'][$listIdent]
                );
            }
        }

        if (isset($objListData['object_actions']) && isset($adminMetadata['list_object_actions'])) {
            $extraObjectActions = array_intersect(
                array_keys($adminMetadata['list_object_actions']),
                array_keys($objListData['object_actions'])
            );
            foreach ($extraObjectActions as $listIdent) {
                $objListData['object_actions'][$listIdent] = array_replace_recursive(
                    $adminMetadata['list_object_actions'][$listIdent],
                    $objListData['object_actions'][$listIdent]
                );
            }
        }

        if (isset($objListData['orders']) && isset($adminMetadata['list_orders'])) {
            $extraOrders = array_intersect(
                array_keys($adminMetadata['list_orders']),
                array_keys($objListData['orders'])
            );
            foreach ($extraOrders as $listIdent) {
                $collectionConfig['orders'][$listIdent] = array_replace_recursive(
                    $adminMetadata['list_orders'][$listIdent],
                    $objListData['orders'][$listIdent]
                );
            }
        }

        if (isset($objListData['filters']) && isset($adminMetadata['list_filters'])) {
            $extraFilters = array_intersect(
                array_keys($adminMetadata['list_filters']),
                array_keys($objListData['filters'])
            );
            foreach ($extraFilters as $listIdent) {
                $collectionConfig['filters'][$listIdent] = array_replace_recursive(
                    $adminMetadata['list_filters'][$listIdent],
                    $objListData['filters'][$listIdent]
                );
            }
        }

        if ($collectionConfig) {
            $this->mergeCollectionConfig($collectionConfig);
        }

        return $objListData;
    }
520710
public function getDataRows()
    {
        $list = array();
        foreach ($this->components as $child) {
            if ($child instanceof DataRow) {
                $list[] = $child;
            }
        }
        return $list;
    }
757628
public function getRecords()
    {
        $ids = $this->getRecordIDList();

        if ($ids) {
            $class = $this->gridField->list->dataClass;

            return DataList::create($class)->byIDs($ids);
        } else {
            return false;
        }
    }
914050
public function getActionByName(WorkflowDescriptor $wf, $actionName)
    {
        $actionName = (string)$actionName;

        foreach ($wf->getGlobalActions() as $actionDescriptor) {
            if ($actionName === $actionDescriptor->getName()) {
                return $actionDescriptor;
            }
        }

        foreach ($wf->getSteps() as $stepDescriptor) {
            $actions = $stepDescriptor->getActions();
            foreach ($actions as $actionDescriptor) {
                if ($actionName === $actionDescriptor->getName()) {
                    return $actionDescriptor;
                }
            }
        }

        foreach ($wf->getInitialActions() as $actionDescriptor) {
            if ($actionName === $actionDescriptor->getName()) {
                return $actionDescriptor;
            }
        }

        return null;
    }
1258165
public function getDashboardActions()
    {
        $actions = [];

        if ($this->hasRoute('create') && $this->hasAccess('create')) {
            $actions['create'] = [
                'label' => 'link_add',
                'translation_domain' => 'SonataAdminBundle',
                // NEXT_MAJOR: Remove this line and use commented line below it instead
                'template' => $this->getTemplate('action_create'),
                // 'template' => $this->getTemplateRegistry()->getTemplate('action_create'),
                'url' => $this->generateUrl('create'),
                'icon' => 'plus-circle',
            ];
        }

        if ($this->hasRoute('list') && $this->hasAccess('list')) {
            $actions['list'] = [
                'label' => 'link_list',
                'translation_domain' => 'SonataAdminBundle',
                'url' => $this->generateUrl('list'),
                'icon' => 'list',
            ];
        }

        return $actions;
    }
179092
function content()
    {
        if ( $this->Content === null )
        {
            $eventType = $this->eventType();
            $this->Content = $eventType->workflowEventContent( $this );
        }

        return $this->Content;
    }
1117429
public function getList()
    {
        $controller = $this->config['controller'];
        $list = [];
        foreach ($controller as $class)
        {
            if(class_exists($class))
            {
                $module = [];
                $reflection = new \ReflectionClass($class);
                $doc_str = $reflection->getDocComment();
                $doc = new DocParser();
                $class_doc = $doc->parse($doc_str);
                $module =  $class_doc;
                $module['class'] = $class;
                $method = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC);
                $filter_method = array_merge(['__construct'], $this->config['filter_method']);
                $module['actions'] = [];
                foreach ($method as $action){
                    if(!in_array($action->name, $filter_method))
                    {
                        $doc = new DocParser();
                        $doc_str = $action->getDocComment();
                        if($doc_str)
                        {
                            $action_doc = $doc->parse($doc_str);
                            $action_doc['name'] = $class."::".$action->name;
                            if(array_key_exists('title', $action_doc)){
                                if(array_key_exists('module', $action_doc)){
                                    $key = array_search($action_doc['module'], array_column($module['actions'], 'title'));
                                    if($key === false){
                                        $action = $module;
                                        $action['title'] = $action_doc['module'];
                                        $action['module'] = $action_doc['module'];
                                        $action['actions'] = [];
                                        array_push($action['actions'], $action_doc);
                                        array_push($module['actions'], $action);
                                    }else{
                                        array_push($module['actions'][$key]['actions'], $action_doc);
                                    }
                                }else{
                                    array_push($module['actions'], $action_doc);
                                }
                            }
                        }
                    }
                }
                if(array_key_exists('group', $module)){
                    $key = array_search($module['group'], array_column($list, 'title'));
                    if($key === false){ //创建分组
                        $floder = [
                            'title' => $module['group'],
                            'description' => '',
                            'package' => '',
                            'class' => '',
                            'actions' => []
                        ];
                        array_push($floder['actions'], $module);
                        array_push($list, $floder);
                    }else{
                        array_push($list[$key]['actions'], $module);
                    }
                }else{
                    array_push($list, $module);
                }
            }
        }
        return $list;
    }
410410
protected function getDefaultRowActionInstance()
    {
        // Make the first action that is allowed for the current user
        foreach ($this->getModelInformation()->list->default_action as $data) {

            $permissions = $data->permissions();

            if ( ! empty($permissions) && ! cms_auth()->can($permissions)) {
                continue;
            }

            $instance = $this->getActionStrategyFactory()->make($data->strategy);

            // Initialize the instance with extra information
            $instance->initialize($data, $this->getModelInformation()->modelClass());

            return $instance;
        }

        return false;
    }
319578
public function getBatchActions()
    {
        if (null === $this->batchActions) {
            $this->batchActions = array();
            $this->findBatchActions();
        }

        return $this->batchActions;
    }
653550
public function actionList()
    {
        if (!Yii::$app->user->isGuest) {
            $searchModel = new SearchViewedProduct();
            $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

            return $this->render('list', [
                'searchModel' => $searchModel,
                'dataProvider' => $dataProvider,
            ]);
        } else throw new NotFoundHttpException();
    }
1242816
protected function _getActionGroups()
    {
        $action = $this->_action();
        $groups = $action->getConfig('scaffold.action_groups') ?: [];

        $groupedActions = [];
        foreach ($groups as $group) {
            $groupedActions[] = array_keys(Hash::normalize($group));
        }

        // add "primary" actions (primary should rendered as separate buttons)
        $groupedActions = (new Collection($groupedActions))->unfold()->toList();
        $groups['primary'] = array_diff(array_keys($this->_getAllowedActions()), $groupedActions);

        return $groups;
    }
950233
protected function queryList()
    {
        // Sanity check
        $dataClass = $this->dataRecord->getDataClass();
        if (!$dataClass) {
            return ArrayList::create();
        }

        // Setup
        $singleton = $this->dataRecord->getDataSingleton();

        // Create list
        $list = $singleton->get();

        // Setup filters
        $filters = [];
        foreach ($singleton->config()->get('searchable_fields') as $field) {
            $value = $this->getRequest()->getVar(str_replace('.', '_', $field));
            if (!$value) {
                continue;
            }

            // if the searchable field is a relationship, it must be an exact match (ID match) if not partial is fine.
            $matchType = $this->instanceHasRelationship($singleton, $field) ? "ExactMatch" : "PartialMatch";
            $filters[$field . ':' . $matchType] = $value;
        }
        $list = $list->filter($filters);

        // Sort
        $sort = $this->getRequest()->getVar('Sort');
        if ($sort) {
            $dir = 'ASC';
            if ($this->getRequest()->getVar('Dir')) {
                $dir = $this->getRequest()->getVar('Dir');
            }
            $list = $list->sort($sort, $dir);
        }

        return $list;
    }
794017
public function getExcelActions()
  {
      if (null === $this->excelActions) {
          $this->excelActions = array();
          $this->fillExportActions();
      }

      return $this->excelActions;
  }
757730
public function getWorkflow()
	{
		return $this->hasWorkflowStatus() ? $this->getWorkflowSource()->getWorkflow($this->getWorkflowStatus()->getWorkflowId()) : null;
	}