Set the necessary redirect.

@param AnCommandContext $context
19499
public function redirect(AnCommandContext $context)
    {
        $url['view'] = AnInflector::pluralize($this->getIdentifier()->name);
        $url['option'] = $this->getIdentifier()->package;

        if ($context->action == 'add') {
            $url['id'] = $this->getItem()->id;
        } elseif ($context->action == 'delete') {
            $url['oid'] = $this->getItem()->owner->id;
        }

        $this->getResponse()->setRedirect(route($url));
    }
338952
protected function _afterEntityDelete(AnCommandContext $context)
    {
        $this->ownable->getRepository()->getBehavior('sharable')->resetStats(array($this->ownable));
    }
515269
public function execute($name, AnCommandContext $context)
    {
        $parts = explode('.', $name);

        if ($parts[0] == 'before') {
            $value = pick($this->{$this->getIdentifiableKey()}, $context->data->{$this->getIdentifiableKey()});

            if ($value) {
                $parent = $this->getParentRepository()->fetch($value);

                $this->setParent($parent);

                //set the entity owner as the context actor of the controller
                if ($parent && $this->getRepository()->isOwnable() && $this->isOwnable()) {
                    $this->setActor($parent->owner);
                }

                $context->data['parent'] = $parent;
            }
        }
    }
1042501
public void redirectToContextPath(String path) {
        if ("".equals(contextPath)) {
            // context path is the root
            redirect(path);
        } else {
            redirect(contextPath + StringUtils.addStart(path, "/"));
        }
    }
1331439
protected function _actionBrowse(AnCommandContext $context)
    {
        $entities = parent::_actionBrowse($context);

        $entities->order($this->sort);

        return $entities;
    }
557849
protected function _actionRemoveapp(AnCommandContext $context)
    {
        $data = $context->data;
        $this->getItem()->components->extract($data->app);
        $this->commit();
    }
64345
public function setSuccessRedirect(\Zend\Mvc\Controller\Plugin\Redirect $redirect, $route, $params = []) {
		$this->redirect = $redirect;
		$this->redirectRoute = $route;
		$this->params = $params;
	}
21493
protected function _actionEdit(AnCommandContext $context)
    {
        $context->response->status = AnHttpResponse::RESET_CONTENT;

        return $this->getItem()->setData($context['data']);
    }
1334462
protected function _actionUnlead(AnCommandContext $context)
    {
        $this->getResponse()->status = AnHttpResponse::RESET_CONTENT;
        $this->getItem()->removeLeader($this->actor);

        return $this->getItem();
    }
918405
public function setTaxInfo(AnCommandContext $context)
    {
        $vats = $context->data->federal_tax;
        $this->getItem()->setFederalTax(AnConfig::unbox($vats));
    }
48252
protected function _actionDelete(AnCommandContext $context)
    {
        if ($session = $this->actor->sessions->find(array('api' => $this->getIdentifier()->name))) {
            $session->delete()->save();
        }
    }
1038367
protected function _afterEntityInsert(AnCommandContext $context)
    {
        if ($this->isOwnable() && $this->owner->isNotifiable() && !$this->owner->eql($this->author)) {
            $this->addSubscriber($this->owner);
        } elseif (!empty($this->author)) {
            $this->addSubscriber($this->author);
        }
    }
1264057
protected function _actionRedirect(DispatcherContext $context)
    {
        $url = $context->param;

        $context->response->setStatus(DispatcherResponse::MOVED_PERMANENTLY);
        $context->response->setRedirect($url);

        //Send the response
        return $this->send($context);
    }
867049
public function initializeContext(Context $context)
    {
        if (!$context instanceof GuzzleAwareContext) {
            return;
        }

        $context->setGuzzleClient($this->client);
        $context->setGuzzleParameters($this->parameters);
    }
323463
protected function _actionAdd(AnCommandContext $context)
    {
        $context->response->status = AnHttpResponse::CREATED;
        $entity = $this->getRepository()->getEntity()->setData($context['data']);
        $this->setItem($entity);

        return $this->getItem();
    }
1006533
protected function _actionAddsubscriber(AnCommandContext $context)
    {
        if ($subscription = $this->_subscriber->subscribeTo($this->getItem())) {
            $subscription->endDate = $context->data->endDate;
        }
    }
271481
public function setPageTitle(AnCommandContext $context)
    {
        $controller = $this->getController();

        if (! $controller->isIdentifiable()) {
            return;
        }

        $view = $controller->getView();
        $document = $this->getService('anahita:document');

        //@TODO temporary fix
        if ($document->getTitle()) {
            return;
        }

        $item = $controller->getState()->getItem();
        $actorbar = $controller->actorbar;

        $title = array();
        $description = null;

        if ($actorbar && $actorbar->getActor()) {
            if ($actorbar->getTitle()) {
                $title[] = $actorbar->getTitle();
            }

            $description = $actorbar->getDescription();
        } else {
            $title[] = ucfirst($view->getName());
        }

        if ($item && $item->isDescribable()) {
            array_unshift($title, $item->name);
            $description = $item->body;
        }

        $title = implode(' - ', array_filter(array_unique($title)));

        $document->setTitle($title);
        $document->setDescription($description);

        if ($item) {
            $document->setLink(route($item->getURL()));
            if ($item->isPortraitable()) {
                $document->setImage($item->getPortraitURL('large'));
            } else if ($item->isCoverable()) {
                $document->setImage($item->getCoverURL('large'));
            }

            if ($item instanceof ComActorsDomainEntityActor) {
                $document->setType('profile');
            }

            if ($item instanceof ComMediumDomainEntityMedium) {
                $document->setType('article');
            }
        }
    }