Gibt die RequestMeta für den aktuellen Kontext für ein Entity zurück

bei context: action muss requestMetaAction gesetzt sein
@return Psc\CMS\RequestMeta
545866
public function getTabRequestMeta() {
    if (!isset($this->tabRequestMeta)) {
      if ($this->context === self::CONTEXT_ACTION) {
        $this->tabRequestMeta = $this->entityMeta->getActionRequestMeta($this->requestMetaAction, $this->entity);
      } else {
        $this->tabRequestMeta = $this->entityMeta->getDefaultRequestMeta($this->entity);
      }
    }
    return $this->tabRequestMeta;
  }
944114
public function indexAction()
    {
        parent::indexAction();

        $this->flashMessenger()->addSuccessMessage('Action not enabled');
        
        return $this->redirect()->toRoute('history-index');
        
        $request = $this->getRequest();

        $id = $this->params()->fromRoute('id');

        $entity = $this->service->get($id);

        if(! $entity) {
        	$this->flashMessenger()->addErrorMessage('Object was not found');
        	return $this->redirect()->toRoute('history-index');
        }

        if ($request->isPost()) {
        	$postData = $request->getPost();

        	$this->form->setData($postData);

        	if ($this->form->isValid()) {
        		$entity = $this->form->getData();

        		$historyEntity = $this->service->save($entity);

        		$this->getEventManager()->trigger('historyCreate', $this, array(
        			'authId' => $this->identity()->getAuthId(),
        			'requestUrl' => $this->getRequest()->getUri(),
        			'historyEntity' => $entity
        		));

        		$this->flashMessenger()->addSuccessMessage('Object was saved');

        		return $this->redirect()->toRoute('history-view', array(
        			'id' => $historyEntity->getHistoryId()
        		));
        	}
        }

        $this->form->bind($entity);

        return new ViewModel(array(
        	'form' => $this->form
        ));
    }
797350
public function getDispatchAction()
    {
        $args = $this->request->getAsArray('args');
        $arg = array_shift($args);
        if (preg_match('/^(\w+\.\w+)$/', $arg, $matches)) {
            $action = $matches[1];
            return $action;
        }
    }
427660
public function defaultAction()
    {
        $em = $this->getEntityManager();
        $pagerParams = ['itemsCountPerPage' => static::ITEMS_ON_PAGE, 'sort' => Application::getRequest()->getSort(),];
        $repository = $em->getRepository($this->entityName);

        $grid = new \Cmf\Component\Grid([
            'fields' => $this->getFieldsConfig(),
            'data' => $repository,
            'pager' => $pagerParams,
            'idField' => 'id',
            'actionLinks' => $this->getActionLinkConfig(),
        ]);

        return ['grid' => $grid];
    }
660136
public function getRequest()
    {
        if ($this->hasRequest() === false) {
            // Try to get request from container.
            $this->setRequest($this->getContainer()->get('request_stack')->getCurrentRequest());
        }

        if ($this->hasRequest() === false) {
            throw new \RuntimeException("Sorry, the request is not available in this context");
        }

        return $this->request;
    }
189602
public function showAction()
    {
        $id = (int) $this->params()->fromRoute('id', null);

        $service = $this->getService();
        $entity  = $service->getById($id);

        return new ViewModel(array(
            'entity'  => $entity,
            'options' => $this->getOptions(),
        ));
    }
1233846
public function getRequest()
    {
        if (null == $this->request) {
            $this->setRequest(Application::container()->get('request'));
        }
        return $this->request;
    }
489936
public function actionLoad()
    {
        $rr = new RequestResponse();
        if ($rr->isRequestAjaxPost()) {
            \Yii::$app->cmsAgent->loadAgents();
            $rr->message = \Yii::t('skeeks/agent', 'Agents have been updated successfully');
            $rr->success = true;
            return $rr;
        }
    }
302587
public function getMeta()
    {
        $meta = $this->unitOfWork->getEntityRegistry()->getEntityBuilder()->getMeta($this->className);

        return $meta;
    }
646183
public function pageAction()
    {
        $path = $this->params()->fromRoute('path');
        $page = $this->queryService->findPublishedPageByPath(trim($path, '/'));

        if ($page instanceof NullPage) {
            /** @var Response $response */
            $response = $this->getResponse();
            $response->setStatusCode(Response::STATUS_CODE_404);
            return null;
        }

        return new ViewModel(array('page' => $page));
    }
306437
public function getMeta()
	{
		// Build the request path.
		$path = '/meta';

		return $this->processResponse($this->client->get($this->fetchUrl($path)), 200);
	}
1027774
public function indexAction()
    {
        if (!$this->rcmUserService->isAllowed(ResourceName::RESOURCE_SITES, 'admin')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $this->layout()->setTemplate('layout/blank');

        $view = new ViewModel();
        $view->setVariable(
            'siteSettingsSectionDefinitions',
            $this->getSettingsSectionDefinitions->__invoke()
        );

        return $view;
    }
255319
public function getActionRequestMeta($action, Entity $entity = NULL, $method = \Psc\Net\HTTP\Request::GET) {
    if (!array_key_exists($action, $this->actionsRequestMeta)) {
      $idIsInt = ($identifierType = $this->getIdentifier()->getType()) instanceof IntegerType;
      $this->actionsRequestMeta[$action] = new RequestMeta($method,
                                               $this->constructUrl(array($this->getEntityName(), ($idIsInt ? '%d' : '%s'), $action)),
                                               array($identifierType)
                                              );
    }
    
    if (isset($entity)) {
      $meta = clone $this->actionsRequestMeta[$action];
      return $meta->setInput($entity->getIdentifier());
    } else {
      return $this->actionsRequestMeta[$action];
    }
  }
84909
public function cgetAction(Request $request)
    {
        $locale = $this->getUser()->getLocale();

        if ('true' == $request->get('flat')) {
            /** @var RestHelperInterface $restHelper */
            $restHelper = $this->get('sulu_core.doctrine_rest_helper');

            $fieldDescriptors = $this->getFieldDescriptors();
            $listBuilder = $this->generateFlatListBuilder();
            $restHelper->initializeListBuilder($listBuilder, $fieldDescriptors);
            $this->applyRequestParameters($request, $listBuilder);

            $listResponse = $listBuilder->execute();
            $listResponse = $this->addLogos($listResponse, $locale);

            $list = new ListRepresentation(
                $listResponse,
                self::$entityKey,
                'get_accounts',
                $request->query->all(),
                $listBuilder->getCurrentPage(),
                $listBuilder->getLimit(),
                $listBuilder->count()
            );
            $view = $this->view($list, 200);
        } else {
            $filter = $this->retrieveFilter($request);
            $accountManager = $this->getAccountManager();
            $accounts = $accountManager->findAll($locale, $filter);
            $list = new CollectionRepresentation($accounts, self::$entityKey);
            $view = $this->view($list, 200);
        }

        $context = new Context();
        $context->setGroups(['fullAccount', 'partialContact', 'Default']);
        $view->setContext($context);

        return $this->handleView($view);
    }
1195265
public function updateManyToOneAction(Request $request)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this->getAdmin();

        $admin->checkAccess('edit');

        $em = $admin->getDoctrine()->getManager();

        $ids = $request->request->get('value');
        $id = $request->request->get('pk');
        $field = $request->request->get('field');

        $object = $admin->getObject($id);

        /** @var \Sonata\DoctrineORMAdminBundle\Model\ModelManager $mm */
        $mm = $admin->getModelManager();

        $ClassMetadata = $mm->getMetadata($admin->getClass());

        $associationMapping = $ClassMetadata->getAssociationMapping($field);

        $items = $em->getRepository($associationMapping['targetEntity'])->find($ids);

        \call_user_func([$object, 'set' . ucfirst($field)], $items);

        $admin->update($object);

        $result = [
        ];

        $associationAdmin = $admin->getAdminByClass($associationMapping['targetEntity']);

        $twigSonataAdminExtension = $admin->getContainer()->get('sonata.admin.twig.extension');

        $fieldDescription = $admin->getListFieldDescription($field);

        if ($items) {
            $result[] = [
                'id' => $items->getId(),
                'label' => $twigSonataAdminExtension->renderRelationElement($items, $fieldDescription),
                'edit_url' => $associationAdmin->generateObjectUrl('edit', $items),
            ];
        }

        return new JsonResponse([
            'items' => $result,
        ]);
    }
209205
public function cgetAction(Request $request)
    {
        $filter = $this->getManager()->getFilters($request);
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));

        if ($request->get('flat') == 'true') {
            $filterFieldDescriptors = $this->getManager()->getFilterFieldDescriptors();
            $fieldDescriptors = $this->getManager()->getFieldDescriptors(
                $locale
            );

            $list = $this->flatResponse(
                $request,
                $filter,
                $filterFieldDescriptors,
                $fieldDescriptors,
                static::$entityName
            );
        } elseif ($request->get('ids') !== '') {
            $list = new CollectionRepresentation(
                $this->getManager()->findAllByIdsAndLocale($locale, $request->get('ids')),
                self::$entityKey
            );
        } else {
            $list = new CollectionRepresentation(
                $this->getManager()->findAllByLocale($locale, $filter),
                self::$entityKey
            );
        }

        $view = $this->view($list, 200);

        return $this->handleView($view);
    }
812529
public function cgetAction(Request $request)
    {
        if ('true' == $request->get('flat')) {
            /** @var RestHelperInterface $restHelper */
            $restHelper = $this->get('sulu_core.doctrine_rest_helper');

            /** @var DoctrineListBuilderFactory $factory */
            $factory = $this->get('sulu_core.doctrine_list_builder_factory');

            $listBuilder = $factory->create(static::$entityName);

            $restHelper->initializeListBuilder($listBuilder, $this->fieldDescriptors);

            $list = new ListRepresentation(
                $listBuilder->execute(),
                static::$entityKey,
                'get_groups',
                $request->query->all(),
                $listBuilder->getCurrentPage(),
                $listBuilder->getLimit(),
                $listBuilder->count()
            );
        } else {
            $list = new CollectionRepresentation(
                $this->getDoctrine()->getRepository(static::$entityName)->findAllGroups(),
                static::$entityKey
            );
        }
        $view = $this->view($list, 200);

        return $this->handleView($view);
    }