Executes the widget.
@return string the result of widget execution to be outputted.
439697
public function run()
    {
        /* @var $module Module */
        $module = Yii::$app->getModule(Module::$name);
        $commentModelData = $module->model('comment');

        //Create comment model
        /** @var CommentModel $commentModel */
        $commentModel = Yii::createObject($commentModelData);

        //Get entity from widget and hash it.
        if ($this->model)
        {
            $entityModel = $this->model;
            $this->entityId = $entityModel->{$this->entityIdAttribute};
            $this->entity = $commentModel::hashEntityClass($entityModel::className());
        }

        // Add the basic data into the CommentModel in case we need it to
        // check for permissions
        $commentModel->entity = $this->entity;
        $commentModel->entityId = $this->entityId;

        //Encrypt entity and entityId values
        $this->encryptedEntity = base64_encode(Yii::$app->getSecurity()->encryptByKey(Json::encode([
            'entity' => $this->entity,
            'entityId' => $this->entityId,
            'maxLevel' => $this->maxLevel,
            'entityIdAttribute' => $this->entityIdAttribute,
            'clientOptions' => $this->clientOptions,
            'pjax' => $this->pjax,
            'showDeletedComments' => $this->showDeletedComments,
            'nestedBehavior' => $this->nestedBehavior
        ]), $module::$name));

        $query = $commentModel::find()
            ->where(['entity' => $this->entity, 'entityId' => $this->entityId]);

        if ($this->nestedBehavior === TRUE)
        {
            // Make eager subqueries to the max level defined in the widget
            $children = array_fill(0, $this->maxLevel, 'children');
            $query = $query->andWhere(['parentId' => NULL])
                ->with([implode('.', $children), 'author']);
        }
        else
        {
            $query = $query->with(['author']);
        }

        if ($this->showDeletedComments === FALSE)
        {
            $query->andWhere(['!=', 'status', CommentStatus::DELETED]);
        }

        $dataProvider = new ArrayDataProvider([
            'allModels' => $query->all(),
            'sort' => $this->sort,
            'pagination' => $this->pagination
        ]);

        return $this->render('index', [
            'commentModel' => $commentModel,
            'provider' => $dataProvider,
            'widget' => &$this
        ]);
    }
1032010
protected function _execute()
    {
        if (!$this->enabled() && !$this->focused()) {
            return;
        }
        foreach ($this->_children as $child) {
            if ($this->suite()->failfast()) {
                break;
            }
            $this->_passed = $child->process() && $this->_passed;
        }
    }
10180
public function execute()
	{
		if ($this->output->isInteractive())
		{
			$actions = array('add', 'delete', 'install', 'enable', 'disable');
			$action  = $this->output->getResponse('What do you want to do? ['.implode("|", $actions).']');

			if (in_array($action, $actions))
			{
				$this->$action();
			}
			else
			{
				$this->output->error('Sorry, I don\'t know how to do that.');
			}
		}
		else
		{
			$this->output = $this->output->getHelpOutput();
			$this->help();
			$this->output->render();
			return;
		}
	}
869499
public function execute()
    {
        $curdir = getcwd();
        chdir($this->workingdir);

        $phpcsfixer = $this->phpci->findBinary('php-cs-fixer');

        $cmd = $phpcsfixer . ' fix . %s %s %s';
        $success = $this->phpci->executeCommand($cmd, $this->verbose, $this->diff, $this->level);

        chdir($curdir);

        return $success;
    }
436421
public function execute() {

		foreach($this -> stmt as $stmt) {
			$this -> executeStatement($stmt);
		}

		$this -> shadow = $this -> stmt;
		$this -> reset();

		//Write time for debugging
		$this -> trace = microtime(true) - $this -> trace;

		return true;
	}
414216
public function run() {
		
		list($name) = $this->resolveNameID();

		// TODO: what is this?
		// Add a class of no-user-select to widget
		$this->htmlOptions['class'] = empty($this->htmlOptions['class'])
			? 'no-user-select'
			: 'no-user-select ' . $this->htmlOptions['class'];

		// We are overriding the result of $this->resolveNameID() here, because $id which it emits is not unique through the page.
		if (empty($this->htmlOptions['id'])) {
			$this->htmlOptions['id'] = $this->id;
		}

		// Adding essential class for timepicker to work.
		$this->wrapperHtmlOptions = $this->injectClass($this->wrapperHtmlOptions, 'bootstrap-timepicker');

		if (!$this->noAppend)
			$this->wrapperHtmlOptions = $this->injectClass($this->wrapperHtmlOptions, 'input-group');


		echo CHtml::openTag('div', $this->wrapperHtmlOptions);
		if ($this->hasModel()) {
			if ($this->form) {
				echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
			} else {
				echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
			}
		} else {
			echo CHtml::textField($name, $this->value, $this->htmlOptions);
		}
		if (!$this->noAppend)
			$this->echoAppend();
		echo CHtml::closeTag('div');

		$this->registerClientScript($this->id);
	}
1285417
public function run()
    {
        $this->registerPlugin('alert');

        if (!empty($this->body)) {
            return Html::tag('div', $this->renderBodyBegin() . $this->renderBodyEnd(), $this->options);
        } else {
            return '';
        }


    }
706128
public function run()
    {
        if (empty($this->items)) {
            return null;
        }
        $this->renderLinks();
        $this->renderTemplate();
        $this->registerClientScript();
    }
838557
public function run()
    {
        $this->setMode();
        $this->checkBox();
        $this->checkCookie();
        $this->checkContent();
        $this->setDefaults();
        $this->initCookie();

        return $this->render(
                $this->mode == 'custom' 
                    ? $this->cookieView 
                    : 'box', 
                $this->prepareViewParams()
            );
    }
1149181
public function execute()
    {
        switch ($this->called) {
        case 'textarea':
            $Tag = new HTML\Tag($this->called, array($this->args[0], $this->args[1]), array('generate', 'inlineInner'));
            break;
        default:
            $Tag = new HTML\Tag($this->called, array($this->args[0]), array('generate'));
            break;
        }

        if ($this->called == 'checkbox' && isset($this->args[2])
            && ($this->args[2] === true || $this->args[2] === 'on' || $this->args[2] === 1
                || $this->args[2] === $Tag->attributes['id']
                || (is_array($this->args[2]) && in_array($Tag->attributes['id'], $this->args[2]))
            )
        ) {
            $Tag->setAttrs(array('checked' => null));
        }

        if ($this->_label !== false) {
            $Label = HTML\Generator::getLabel($this->_label, $Tag);

            HTML\Generator::appendLabel($Label, $Tag, $this->_label);
        } else {
            echo $Tag;
        }
    }
1085856
public function execute() {
        global $OUTPUT, $PAGE;

        $models = \core_analytics\manager::get_all_models(true);
        if (!$models) {
            mtrace(get_string('errornoenabledmodels', 'tool_analytics'));
            return;
        }

        foreach ($models as $model) {

            if ($model->is_static()) {
                // Skip models based on assumptions.
                continue;
            }

            if (!$model->get_time_splitting()) {
                // Can not train if there is no time splitting method selected.
                continue;
            }

            $result = $model->train();

            // Reset the page as some indicators may call external functions that overwrite the page context.
            \tool_analytics\output\helper::reset_page();

            if ($result) {
                echo $OUTPUT->heading(get_string('modelresults', 'tool_analytics', $model->get_name()));

                $renderer = $PAGE->get_renderer('tool_analytics');
                echo $renderer->render_get_predictions_results($result, $model->get_analyser()->get_logs());
            }
        }
    }
814200
public function run()
    {
        $model = $this->findModel();
        $model->content = $this->parseBaseTemplateParams($model->content);

        return $this->controller->render($this->view, [
            'model' => $model,
            'commentWidgetParams' => $this->commentWidgetParams,
        ]);
    }
941387
public function fire()
    {
        $this->displayStatus();

        return $this->runWithBeforeAfterEvents(function () {
            return $this->local ? $this->on('local', [$this, 'execute']) : $this->execute();
        });
    }
273099
public function execute()
    {
        $queue = $this->container->getDelayedExecutionTaskQueue();
        if($queue->length() == 0){
            return;
        }
        ignore_user_abort(true);
        $queue->execute();
    }
163052
public function handle()
    {
        @ob_start();
        $ret = call_user_func_array([$this->di->get($this->module), $this->fun], $this->args);
        $out = ob_get_clean();
        ob_end_clean();

        return $this->packResult(['return' => $ret, 'output' => $out ?: '']);
    }
1154087
protected function execute()
    {
        $classes = get_declared_classes();
        eval($this->script);
        $this->newClasses = array_diff(get_declared_classes(), $classes);
    }
370298
public function execute()
    {

        $template = $this->_initTemplate();

        try {
            $parts = $this->emailConfig->parseTemplateIdParts(self::INVOICE_TMEPLTE_ID);
            $templateId = $parts['templateId'];
            $theme = $parts['theme'];

            if ($theme) {
                $template->setForcedTheme($templateId, $theme);
            }

            $template->setForcedArea($templateId);

            $template->loadDefault($templateId);
            $template->setData('orig_template_code', $templateId);
            $template->setData(
                'template_variables',
                Zend_Json::encode($template->getVariablesOptionArray(true))
            );

            $templateBlock = $this->_view->getLayout()->createBlock(
                \Magento\Email\Block\Adminhtml\Template\Edit::class
            );
            $template->setData(
                'orig_template_currently_used_for',
                $templateBlock->getCurrentlyUsedForPaths(false)
            );

            $this->getResponse()->representJson(
                $this->jsonHelperData
                    ->jsonEncode($template->getData())
            );
        } catch (Exception $e) {
            $this->messageManager->addErrorMessage($e, 'There was a problem:' . $e->getMessage());
        }

        $customVariables = $this->variableModel
            ->getVariablesOptionArray(true);
        $storeContactVariables = $this->variablesFacrory->create()->toOptionArray(true);
        /** @var Json $resultJson */
        $resultJson = $this->resultJsonFactory->create();
        return $resultJson->setData([
            $storeContactVariables,
            $customVariables,
            $template->getVariablesOptionArray(true)
        ]);
    }