@param \Seat\Web\Http\Validation\StarbaseModule $request
@param                                          $corporation_id

@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
346220
public function postStarbaseModules(StarbaseModule $request, int $corporation_id)
    {

        $starbase = $this->getCorporationStarbases($corporation_id, $request->starbase_id)->first();
        $starbase_modules = $this->getStarbaseModules($corporation_id, $request->starbase_id);

        return view('web::corporation.starbase.ajax.modules-tab',
            compact('starbase', 'starbase_modules'));

    }
341275
public function getCorporationWalletTransactions(
        int $corporation_id, bool $get = true, int $chunk = 50)
    {

        $transactions = CorporationWalletTransaction::where('corporation_id', $corporation_id);

        if ($get)
            return $transactions->orderBy('date', 'desc')
                ->paginate($chunk);

        return $transactions;
    }
927476
public function validateCuponCodeAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Transaction $entity */
        $entity = $em->getRepository('EcommerceBundle:Transaction')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Transaction entity.');
        }

        $form = $this->createFormBuilder(null)
            ->add('cuponCode', 'text', array(
                    'required' => true
                ))
            ->getForm();

        if ($request->isMethod('POST')) {
            $form->bind($request);
            $data = $form->getNormData();
            
            if ($data['cuponCode'] != '' && $entity->getStorePickupCode() == $data['cuponCode']) {
                $entity->setStatus(Transaction::STATUS_PAID);

                $em->persist($entity);
                $em->flush();

                $this->get('core.mailer')->sendCuponCodeEmailMessage($entity);

                $this->get('session')->getFlashBag()->add('success', 'transaction.validate');
            }else{
                $this->get('session')->getFlashBag()->add('success', 'transaction.validate.invalid');
            }

            return $this->redirect($this->generateUrl('core_actor_show', array('id' => $entity->getItems()->first()->getProduct()->getActor()->getId(), 'transactions' => 1)));
        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }
125249
public function deleteCorporation(int $corporation_id)
    {

        CorporationInfo::find($corporation_id)->delete();

        return redirect()->back()->with(
            'success', 'Corporation deleted!'
        );
    }
1132373
public function putAction(Request $request, $id)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));

        try {
            $attribute = $this->getManager()->save(
                $request->request->all(),
                $locale,
                $this->getUser()->getId(),
                $id
            );
            $view = $this->view($attribute, 200);
        } catch (AttributeDependencyNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (AttributeNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 404);
        } catch (MissingAttributeException $exc) {
            $exception = new MissingArgumentException(self::$entityName, $exc->getAttribute());
            $view = $this->view($exception->toArray(), 400);
        }

        return $this->handleView($view);
    }
688612
public function editAction(Request $request, $id = null)
    {
        $this->denyAccessUnlessGranted('ROLE_ADMIN');

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

        if (is_numeric($id)) {
            $locale = $em->getRepository(Locale::class)->find($id);
        } else {
            $locale = $em->getRepository(Locale::class)->findOneByLocale($id);
        }

        $form = $this->createForm(new LocaleType(), $locale);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em->persist($locale);
            $em->flush();

            $this->addFlash('success', 'Locale has been updated successfully');

            return $this->redirectToRoute('opifer_cms_locale_edit', ['id' => $locale->getId()]);
        }

        return $this->render('OpiferCmsBundle:Backend/Locale:edit.html.twig', [
            'locale' => $locale,
            'form' => $form->createView()
        ]);
    }
1247518
public function fetch($id, Request $request)
    {
        $category = $this->model()->find($id);

        if (is_null($category) || !$category->exists) {
            return $this->notFoundResponse();
        }

        if ($category->private) {
            $this->authorize('view', $category);
        }

        return $this->response($category);
    }
150029
public function create(Request $request)
    {
        app('soda.interface')->setHeading('New Role');
        app('soda.interface')->breadcrumbs()->addLink(route('soda.roles.index'), 'Roles');

        try {
            $role = $this->roles->newInstance($request);
            $permissionIds = $this->roles->getPermissions();
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.create', ['object' => 'role']));
        }

        return soda_cms_view('data.roles.view', compact('role', 'permissionIds'));
    }
590932
public function show($id, ShowRequest $request)
    {
        $role = $this->repository->findWithoutFail($id);
        $role->load($request->getWith());

        if (empty($role)) {
            return $this->sendError('Role not found');
        }

        return $this->sendResponse($role, '');
    }
236507
public function crudEdit(Request $request, $id)
    {
        try{
            $entity = $this->throwEntityNotFoundException($this->getRepository()->find($id));
            $form = $this->createForm( $this->getEntityType() , $entity)->createView();
            $delete_form = $this->createDeleteForm($id)->createView();
            
            return $this->commonsResponseVars(compact('entity','form','delete_form'));
            
        }catch(\Exception $e){
          return $this->failure($e);
        }
    }
201079
public function updateDatabaseCGU(Request $request, $databox_id)
    {
        $databox = $this->findDataboxById($databox_id);

        try {
            foreach ($request->request->get('TOU', []) as $loc => $terms) {
                $databox->update_cgus($loc, $terms, !!$request->request->get('valid', false));
            }
        } catch (\Exception $e) {
            return $this->app->redirectPath('admin_database_display_cgus', [
                'databox_id' => $databox_id,
                'success'    => 0,
            ]);
        }

        return $this->app->redirectPath('admin_database_display_cgus', [
            'databox_id' => $databox_id,
            'success'    => 1,
        ]);
    }
117730
public function checkAction(Request $request, $id, $repository)
    {
        $entityIsLocked = false;
        $message = '';

        /** @var LockableEntityInterface $entity */
        $entity = $this->getEntityManager()->getRepository($repository)->find($id);

        try {
            /** @var EntityVersionLockService $entityVersionLockservice */
            $entityVersionLockService = $this->get('kunstmaan_entity.admin_entity.entity_version_lock_service');

            $entityIsLocked = $entityVersionLockService->isEntityLocked($this->getUser(), $entity);

            if ($entityIsLocked) {
                $user = $entityVersionLockService->getUsersWithEntityVersionLock($entity, $this->getUser());
                $message = $this->get('translator')->trans('kuma_admin_list.edit.flash.locked', array('%user%' => implode(', ', $user)));
            }
        } catch (AccessDeniedException $ade) {
        }

        return new JsonResponse(['lock' => $entityIsLocked, 'message' => $message]);
    }
362024
public function getAssets(int $corporation_id)
    {

        $divisions = $this->getCorporationDivisions($corporation_id);
        $assets = $this->getCorporationAssets($corporation_id);

        return view('web::corporation.assets', compact('divisions', 'assets'));
    }
1353136
public function show(Request $request, $id)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin']);

        $pagetype = PageType::findOrFail($id);
        $fields = $pagetype->fields;
        return view('page::pagetypes.show', ['pagetype' => $pagetype, 'fields' => $fields]);
    }
1101800
public function removeAction($id, Request $request)
    {
        $cm = new CronManager();
        $this->addFlashFromCronManager($cm);
        $cm->remove($id);
        $this->addFlashFromCronManager($cm);

        return $this->redirect($this->generateUrl('BCCCronManagerBundle_index'));
    }
999689
public function getCorporationAssetContents(int $corporation_id,
                                                int $parent_item_id = null): Collection
    {

        $contents = CorporationAsset::with('type')
            ->where('corporation_id', $corporation_id);

        if (! is_null($parent_item_id))
            $contents = $contents->where('location_id', $parent_item_id);

        return $contents->get();
    }
398895
public function newChildAction(Request $request, ContentNode $parent_node, $contentNode_type, $isSimpleForm = false)
    {
        $factory = $this->get('mm_cmf_content.content_node_factory');
        $repository = $this->getDoctrine()->getRepository('MMCmfNodeBundle:Node');

        //$parent_node = null;
        $entity = $factory->createContentNode($contentNode_type);

        $entity->setParent($parent_node);

        //check if node need "simple" validation
        if ($isSimpleForm)
            $form = $this->createSimpleCreateForm($entity);
        else
            $form = $this->createCreateForm($entity);

        return $this->render('@MMCmfContent/Modal/Form/content_node_new.html.twig', array(
            'entity' => $entity,
            'form' => $form->createView(),
            'modal_id' => ''
        ));
    }