Set scenario
@param string $scenario
@return SharedDataInterface
2749
public function setScenario($scenario) {
        $scenarios = [static::SCENARIO_OVERWRITE, static::SCENARIO_WRITE_ONCE, static::SCENARIO_MERGE];
        if (in_array($scenario, $scenarios)) {
            $this->scenario = $scenario;
        }
        return $this;
    }
697477
public function prepare(&$instance)
    {
        $requirements = $this->getDiRequirements(get_class($instance));

        foreach ($requirements as $propertyName => $property) {

            $dependencyIdentifier = $property['identifier'];
            $dependency = $this->container[$dependencyIdentifier];

            if (!isset($this->container[$dependencyIdentifier])) {
                throw new \InvalidArgumentException("Unable to resolve dependency $dependencyIdentifier for injection");
            }

            if ($property['isPublic']) {
                // If its public, just set it!
                $instance->$propertyName = $dependency;
            } else {
                if ($property['setter']) {
                    // If there is a setter method, use that
                    call_user_func($instance, $property['setter'], $dependency);
                } else {
                    // Otherwise set by brute force
                    $refl = new \ReflectionClass($instance);
                    $prop = $refl->getProperty($propertyName);
                    $prop->setAccessible(true);
                    $prop->setValue($instance, $this->container[$dependencyIdentifier]);
                    $prop->setAccessible(false);
                }
            }

        }

    }
1362254
public function actionLogin($scenario = null)
    {
        /** @var LoginForm */
        $model = $this->module->createFormModel('LoginForm');
        $scenarios = $model->scenarios();
        if ($scenario !== null && in_array($scenario, array_keys($scenarios))) {
            $model->scenario = $scenario;
        }

        if ($model->load($_POST)) {
            if (Yii::$app->request->isAjax) {
                Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

                return \yii\widgets\ActiveForm::validate($model);
            }
            if ($model->validate()) {
                if (($model->scenario !== 'reset' || $model->resetPassword($model->newPassword)) && $model->login($this->module->rememberMeDuration)) {
                    return $this->afterLogin();
                } else {
                    Yii::$app->session->setFlash('error', Yii::t('usr', 'Failed to change password or log in using new password.'));
                }
            }
        }
        list($view, $params) = $this->getScenarioView($model->scenario, 'login');

        return $this->render($view, array_merge(['model' => $model], $params));
    }
217239
@Before()
    public void beforeScenario(Scenario scenario) {
        getContext().setHar(HarContext.getInstance().getServer().newHar(scenario.getName()));
    }
1355760
public function format(array $scenarios)
    {
        return rtrim(implode(
            array_map(
                function (ScenarioInterface $scenario) {
                    return $this->getTags($scenario)
                    . $this->getScenarioDescription($scenario)
                    . $this->getSteps($scenario)
                    . $this->getExamples($scenario);
                },
                $scenarios
            )
        )) . "\n";
    }
1327210
public function setModel(Model $model)
    {
        if (($content = $this->getContent()) instanceof WithModelInterface) {
            $content->setModel($model);
        }

        return $this;
    }
446890
protected function setPlatformRelationship($relationship)
    {
        if (null !== $relationship) {
            $this->writeAttribute(
                $relationship,
                'platform',
                'relationship',
                $this->validator,
                'validatePlatformRelationship',
                $this->exception,
                'Provided relationship is not a valid value.'
            );
        }

        return $this;
    }
190711
private function getScenario( $context )
	{
		if ( is_string( $context ) )
		{
			if ( ! isset( $this->contexts[ $context ] ) ) return null;
			$context = $this->contexts[ $context ];
		}

		if ( isset( $context['scenario'] ) ) return $context['scenario'];
		if ( isset( $context['entity']['scenario'] ) ) return $context['entity']['scenario'];

		return null;
	}
1269575
public function setEnvironment($environment = 'test')
    {
        $environment = trim($environment);
        if ($environment === 'live') {
            //Live
            $this->_setEnvironment = 'https://sis.redsys.es/sis/realizarPago';
        } elseif ($environment === 'test') {
            //Test
            $this->_setEnvironment = 'https://sis-t.redsys.es:25443/sis/realizarPago';
        } else {
            throw new TpvException('Add test or live');
        }

        return $this;
    }
823128
private function configureContext(Context $context)
    {
        foreach ($this->attributes as $key => $value) {
            $context->setAttribute($key, $value);
        }
        if (!empty($this->groups)) {
            $context->setGroups($this->groups);
        }

        if (($context instanceof SerializationContext) && $this->serializeNulls !== null) {
            $context->setSerializeNull($this->serializeNulls);
        }

        if ($this->enableMaxDepthChecks === true) {
            $context->enableMaxDepthChecks();
        }

        if ($this->version !== null) {
            $context->setVersion($this->version);
        }

        return $context;
    }
1197340
public function setCondition($condition)
    {
        if ((!$condition instanceof PaletteConditionInterface)
            && (!$condition instanceof PropertyConditionInterface)
        ) {
            throw new DcGeneralInvalidArgumentException(
                'The condition is invalid. ' .
                ' Only use PaletteConditionInterface or PropertyConditionInterface.'
            );
        }

        $this->condition = $condition;

        return $this;
    }
911685
private function getScenarioDescription(ScenarioInterface $scenario)
    {
        $titleLines    = $this->getTitleLines($scenario);
        $scenarioTitle = trim($scenario->getKeyword() . ': ' . array_shift($titleLines));

        if ($scenario->hasTags()) {
            $scenarioTitle = $this->indent() . $scenarioTitle;
        }

        return implode(
            "\n" . $this->indent(12),
            array_merge(
                [$scenarioTitle],
                $titleLines
            )
        ) . "\n";
    }
113083
public function setEventManager(EventManagerInterface $events)
    {
        $events->setIdentifiers(array(
            __CLASS__,
            get_class($this)
        ));
        $events->setSharedManager(
            $this->getContainer()->get("sharedEventManager")
        );
        $this->_events = $events;
        return $this;
    }
1313001
public UserScenario createUserScenario(final UserScenario scenario) {
        return invoke(USER_SCENARIOS,
                new RequestClosure<JsonObject>() {
                    @Override
                    public JsonObject call(Invocation.Builder request) {
                        String         json = scenario.toJSON().toString();
                        Entity<String> data = Entity.entity(json, MediaType.APPLICATION_JSON_TYPE);
                        return request.post(data, JsonObject.class);
                    }
                },
                new ResponseClosure<JsonObject, UserScenario>() {
                    @Override
                    public UserScenario call(JsonObject json) {
                        return new UserScenario(json);
                    }
                }
        );
    }
313542
public function setRuntime(string $runtime)
    {
        $this->runtime = $runtime;

        $this->hostConfig = array_merge($this->hostConfig, ['Runtime' => $runtime]);

        return $this;
    }
242969
public function setProfile($profile) {
		if (is_string($profile)) {
			$profile = new Profile($profile);
		}
		$this->profile = $profile;
		return $this;
	}
1016500
public function setDe($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->de !== $v) {
            $this->de = $v;
            $this->modifiedColumns[] = CountryPeer::DE;
        }


        return $this;
    }