Set End Time action.

sets correct end date value to be used for a subscription setting

@param AnCommandContext $context Context parameter
@param void
350795
public function setEndDate(AnCommandContext $context)
    {
        $data = $context->data;

        if ($data->day || $data->month || $data->year) {
            $date = new AnDate();
            $date->day((int) $data->day);
            $date->month((int) $data->month);
            $date->year((int) $data->year);
            $data->endDate = $date;
        }
    }
63154
private function setDateContext(\DateTime $dateContext = null)
    {
        if (!$dateContext) { // we havent set context so we need the default to be: now minus 15 mins, rounded to 5 min increment.
            $now = new \DateTime();
            $now->sub(new \DateInterval('PT15M'));
            // round down to 5 minute increment
            $now->setTime($now->format('H'), floor($now->format('i') / 5) * 5, 0);
            $dateContext = $now;
        }
        $this->dateContext = $dateContext;
    }
1053322
protected function _actionProcess(AnCommandContext $context)
    {
        // run this no more than 1 minute
        //set_time_limit(60);

        $query = $this->getService('repos:notifications.notification')
                      ->getQuery(true)
                      ->status(ComNotificationsDomainEntityNotification::STATUS_NOT_SENT);

        if ($this->id) {
            $ids = (array) AnConfig::unbox($this->id);
            $query->id($ids);
        }

        $notifications = $query->fetchSet();

        $this->sendNotifications($notifications);
    }
32467
public void setEnddate(Object enddate) throws PageException {
	if (StringUtil.isEmpty(enddate)) return;
	this.enddate = new DateImpl(DateCaster.toDateAdvanced(enddate, pageContext.getTimeZone()));
    }
561667
protected function _actionDispatch(AnCommandContext $context)
    {
        if ($this->action === 'confirm' && $this->token) {
            $context->data->append(array(
               '_action' => 'confirm',
               'token' => $this->token,
            ));

            return $this->execute('post', $context);
        }

        return parent::_actionDispatch($context);
    }
887652
protected function _actionEdit(AnCommandContext $context)
    {
        $data = $context->data;

        //don't overwrite these two
        unset($data->secret);
        unset($data->dbtype);

        $this->_entity->setData(AnConfig::unbox($data));

        if ($this->_entity->save()) {
            $this->setMessage('COM-SETTINGS-PROMPT-SUCCESS', 'success');
        }
    }
1006893
protected function _actionSend(DispatcherContext $context)
    {
        $request  = $this->getRequest();
        $response = $this->getResponse();

        //Add an Allow header to the response
        if($response->getStatusCode() === HttpResponse::METHOD_NOT_ALLOWED)
        {
            try {
                $this->_actionOptions($context);
            }
            catch (Exception $e) {}
        }

        return parent::_actionSend($context);
    }
695046
protected function _actionSend(DispatcherContext $context)
    {
        //Send the response
        $context->response->send(false);

        //Terminate the response
        $this->terminate($context);
    }
438297
public function redirect(AnCommandContext $context)
    {
        $url = null;

        if ($context->action == 'delete') {
            $url = 'option=com_'.$this->getIdentifier()->package.'&view='.AnInflector::pluralize($this->getIdentifier()->name);
        } elseif ($context->action == 'add') {
            $url = $context->result->getURL().'&get=settings';
        }

        if ($url) {
            $context->response->setRedirect(route($url));
        }
    }
238662
protected function _afterEntityUpdate(AnCommandContext $context)
    {
        if (isset($this->_pending_files[$this->_mixer])) {
            $files = $this->_pending_files[$this->_mixer];

            foreach ($files as $filename => $data) {
                $this->_mixer->writeData($filename, $data);
            }

            unset($this->_pending_files[$this->_mixer]);
        }
    }
546689
public function setDateEnd($end, $field = null)
    {
        $param = $this->buildParam('facet.date.end', $field);
        return $this->set($param, $end);
    }
1035297
protected function _actionAdd(AnCommandContext $context)
    {
        $data = $context->data;
        $value = AnRequest::get('session.invite_token', 'string', null);

        if (empty($data->value) || $value != $data->value) {
            throw new LibBaseControllerExceptionBadRequest('Invalid token signature');
            return;
        }

        AnRequest::set('session.invite_token', null);

        $token = $this->getRepository()->getEntity(array(
                        'data' => array(
                            'value' => $value,
                            'inviter' => get_viewer(),
                            'serviceName' => 'facebook',
                        ),
                    ));

        if (!$token->save()) {
            throw new LibBaseControllerExceptionInternal();
            return;
        }
    }
1342114
protected function terminate($context)
    {
        $handler = $context->getMessageHandler();
        $handler->handle($context->getMessageBeingHandled(), $context);
    }
984115
public function setDateEnd(\DateTime $date_end = null)
    {
        $this->date_end = $date_end ? clone $date_end : null;

        return $this;
    }
18739
protected function _actionAddapp(AnCommandContext $context)
    {
        $data = $context->data;
        $this->getItem()->components->insert($data->app);
        $this->commit();
    }
243390
protected function _actionRead(AnCommandContext $context)
    {
        $apis = ComConnectHelperApi::getServices();

        $this->getService('repos:connect.session');

        $sessions = $this->actor->sessions;

        foreach ($apis as $key => $api) {
            if (!$api->canAddService($this->actor)) {
                unset($apis[$key]);
            }
        }

        $this->apis = $apis;
        $this->sessions = $sessions;
    }
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;
            }
        }
    }