{@inheritdoc}

@throws BuilderException
327998
public function sqlStatement(CompilerInterface $compiler = null): string
    {
        if (empty($compiler)) {
            $compiler = clone $this->compiler;
        }

        if (!$compiler instanceof PostgresCompiler) {
            throw new BuilderException('Postgres InsertQuery can be used only with Postgres driver and compiler');
        }

        /**
         * @var PostgresDriver   $driver
         * @var PostgresCompiler $compiler
         */
        return $compiler->compileInsert(
            $this->table,
            $this->columns,
            $this->rowsets,
            $this->getPrimaryKey($this->compiler->getPrefix(), $this->table)
        );
    }
339242
public function apply(Builder $builder)
    {
        $model = $builder->getModel();

        $builder->whereNull($model->getQualifiedDeletedAtColumn());

        $this->extend($builder);
    }
1297364
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (null !== $this->parent) {
            $this->parent->buildForm($builder, $options);
        }

        $this->innerType->buildForm($builder, $options);

        foreach ($this->typeExtensions as $extension) {
            $extension->buildForm($builder, $options);
        }
    }
275364
public function main()
    {
        if (null === $this->getRepository()) {
            throw new BuildException('"repository" is required parameter');
        }
        $remotes = trim($this->getRemote());
        if (null === $remotes || '' === $remotes) {
            throw new BuildException('"remote" is required parameter');
        }

        $client = $this->getGitClient(false, $this->getRepository());
        $command = $client->getCommand('merge');
        $command
            ->setOption('commit', $this->isCommit())
            ->setOption('q', $this->isQuiet());

        if ($this->getMessage()) {
            $command->setOption('message', $this->getMessage());
        }

        if (!$this->isCommit()) {
            $command->setOption('no-commit', $this->isNoCommit());
        }

        if ($this->isFastForwardCommit()) {
            $command->setOption('no-ff', true);
        }

        $strategy = $this->getStrategy();
        if ($strategy) {
            // check if strategy is valid
            if (false === in_array($strategy, $this->validStrategies)) {
                throw new BuildException(
                    "Could not find merge strategy '" . $strategy . "'\n" .
                    "Available strategies are: " . implode(', ', $this->validStrategies)
                );
            }
            $command->setOption('strategy', $strategy);
            if ($this->getStrategyOption()) {
                $command->setOption(
                    'strategy-option',
                    $this->getStrategyOption()
                );
            }
        }

        $remotes = explode(' ', $this->getRemote());
        foreach ($remotes as $remote) {
            $command->addArgument($remote);
        }

        $this->log('git-merge command: ' . $command->createCommandString(), Project::MSG_INFO);

        try {
            $output = $command->execute();
        } catch (Exception $e) {
            throw new BuildException('Task execution failed.', $e);
        }

        $this->log(
            sprintf('git-merge: replaying "%s" commits', $this->getRemote()),
            Project::MSG_INFO
        );
        $this->log('git-merge output: ' . trim($output), Project::MSG_INFO);
    }
1082495
public function setBuilders($builders)
    {
        if (\is_array($builders)) {
            $builders = implode(',', $builders);
        }

        return $this->setQueryValue('Builders', $builders);
    }
768946
public function main()
    {
        if ($this->length !== null && $this->adjust !== null) {
            throw new BuildException(
                'length and adjust are mutually exclusive options'
            );
        }
        if ($this->length === null && $this->adjust === null) {
            $this->length = 0;
        }
        if ($this->file === null) {
            throw new BuildException('No files specified.');
        }

        if ($this->shouldProcess($this->file)) {
            $this->process($this->file);
        }
    }
582765
public function build(): SetNodeValueRequest
	{
		$instance = new SetNodeValueRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		if ($this->value === null) {
			throw new BuilderException('Property [value] is required.');
		}
		$instance->value = $this->value;
		return $instance;
	}
989298
public function build(): AddBindingRequest
	{
		$instance = new AddBindingRequest();
		if ($this->name === null) {
			throw new BuilderException('Property [name] is required.');
		}
		$instance->name = $this->name;
		$instance->executionContextId = $this->executionContextId;
		return $instance;
	}
283021
public function preSave(\PHP5ObjectBuilder $builder)
    {
        $const = $builder->getColumnConstant($this->getColumnForParameter('slug_column'));
        $pattern = $this->getParameter('slug_pattern');
        $script = "
if (\$this->isColumnModified($const) && \$this->{$this->getColumnGetter()}()) {
    \$this->{$this->getColumnSetter()}(\$this->makeSlugUnique(\$this->{$this->getColumnGetter()}()));";

        if ($pattern && false === $this->booleanValue($this->getParameter('permanent'))) {
            $script .= "
} elseif (";
            $count = preg_match_all('/{([a-zA-Z]+)}/', $pattern, $matches, PREG_PATTERN_ORDER);

            foreach ($matches[1] as $key => $match) {
                $columnName = $this->underscore(ucfirst($match));
                $column = $this->getTable()->getColumn($columnName);
                if ((null == $column) && $this->getTable()->hasBehavior('symfony_i18n')) {
                    $i18n = $this->getTable()->getBehavior('symfony_i18n');
                    $column = $i18n->getI18nTable()->getColumn($columnName);
                }
                if (null == $column) {
                    throw new \InvalidArgumentException(sprintf('The pattern %s is invalid  the column %s is not found', $pattern, $match));
                }
                $columnConst = $builder->getColumnConstant($column);
                $script .= "\$this->isColumnModified($columnConst)" . ($key < $count - 1 ? " || " : "");
            }

            $script .= ") {
    \$this->{$this->getColumnSetter()}(\$this->createSlug());";
        }

        if (null == $pattern && false === $this->booleanValue($this->getParameter('permanent'))) {
            $script .= "
} else {
    \$this->{$this->getColumnSetter()}(\$this->createSlug());
}";
        } else {
            $script .= "
} elseif (!\$this->{$this->getColumnGetter()}()) {
    \$this->{$this->getColumnSetter()}(\$this->createSlug());
}";
        }

        return $script;
    }
1104474
public function main(){
        
        if(is_null($this->getName())){
            throw new \BuildException('the name property is required');
        }

        if(is_null($this->getRetention())){
            throw new \BuildException('the retention property is required');
        }

        try {
            $domain = $this->getService()->describeDomain([
                'name' => $this->getName()
            ]);

            if ($domain->get('domainInfo')['status'] != 'REGISTERED') {
                throw new \BuildException('the domain "' . $this->getName() . '" is no more available');
            }

            $this->log('The domain "' . $this->getName() . '" already exists');
        } catch (SwfException $e) {
            $this->log('Creating "' . $this->getName() . '" domain');

            $this->getService()->registerDomain([
                'name' => $this->getName(),
                'description' => $this->getDescription(),
                'workflowExecutionRetentionPeriodInDays' => $this->getRetention() ?: 'NONE'
            ]);

            $this->log('"' . $this->getName() . '" domain successfully created');
        }
    }
933425
public function main()
    {
        $exc = null;

        if (empty($this->tryContainer)) {
            throw new BuildException('A nested <try> element is required');
        }

        try {
            $this->tryContainer->perform();
        } catch (BuildException $e) {
            if (!empty($this->propertyName)) {
                $this->project->setProperty($this->propertyName, $e->getMessage());
            }

            if (!empty($this->referenceName)) {
                $this->project->addReference($this->referenceName, $e);
            }

            if (!empty($this->catchContainer)) {
                $this->catchContainer->perform();
            } else {
                $exc = $e;
            }
        }

        if (!empty($this->finallyContainer)) {
            $this->finallyContainer->perform();
        }

        if (!empty($exc)) {
            throw $exc;
        }
    }
1290502
public function apply(Builder $builder)
    {
        $sortMethod = 'sort' . studly_case($this->getField());

        if(method_exists($builder->getModel(), $sortMethod)) {
            call_user_func_array([$builder->getModel(), $sortMethod], [$builder, $this->getOrder()]);
        } else {
            $builder->orderBy($this->getField(), $this->getOrder());
        }
    }
639276
@Override
    public Builder create() throws InvalidBuilderException {
        if (!active) {
            // Tr.error(tc, "JWT_BUILDER_NOT_ACTIVE", new Object[] {
            // "defaultJWT" });
            // return null;
            String err = Tr.formatMessage(tc, "JWT_BUILDER_NOT_ACTIVE", new Object[] { "defaultJWT" });
            throw new InvalidBuilderException(err);
        }
        return create("defaultJWT");
    }
1001449
public function process(ContainerBuilder $container)
    {
        $parameterBag = $container->getParameterBag();

        foreach ($container->getDefinitions() as $id => $definition) {
            try {
                $definition->setClass($parameterBag->resolveValue($definition->getClass()));
                $definition->setFile($parameterBag->resolveValue($definition->getFile()));
                $definition->setArguments($parameterBag->resolveValue($definition->getArguments()));

                $factory = $definition->getFactory();

                if (is_array($factory) && isset($factory[0])) {
                    $factory[0] = $parameterBag->resolveValue($factory[0]);
                    $definition->setFactory($factory);
                }

                $calls = array();
                foreach ($definition->getMethodCalls() as $name => $arguments) {
                    $calls[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($arguments);
                }
                $definition->setMethodCalls($calls);

                $definition->setProperties($parameterBag->resolveValue($definition->getProperties()));
            } catch (ParameterNotFoundException $e) {
                $e->setSourceId($id);

                throw $e;
            }
        }

        $aliases = array();
        foreach ($container->getAliases() as $name => $target) {
            $aliases[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($target);
        }
        $container->setAliases($aliases);

        $parameterBag->resolve();
    }
791779
public function build(): GetSearchResultsRequest
	{
		$instance = new GetSearchResultsRequest();
		if ($this->searchId === null) {
			throw new BuilderException('Property [searchId] is required.');
		}
		$instance->searchId = $this->searchId;
		if ($this->fromIndex === null) {
			throw new BuilderException('Property [fromIndex] is required.');
		}
		$instance->fromIndex = $this->fromIndex;
		if ($this->toIndex === null) {
			throw new BuilderException('Property [toIndex] is required.');
		}
		$instance->toIndex = $this->toIndex;
		return $instance;
	}
32732
public function apply(Builder $builder, Model $model)
    {
        //Check if is an override
        //
        $iso = config()->get('local_override');

        if (empty($iso)) {
            $iso = app()->getLocale();
        }

        $builder->whereExists(function($query) use ($model, $iso) {
            $query->select(\DB::raw(1))
                ->from($model->getQualifiedTable())
                ->whereRaw($model->getTable().'.'.$model->getKeyName().' = '.$model->getQualifiedIdElementColumn())
                ->where($model->getQualifiedIsoColumn(), $iso)
                ->where($model->getQualifiedModelColumn(), $model->getTable());
        });

        $this->extend($builder);

    }
440888
public function build(): SetAttributeValueRequest
	{
		$instance = new SetAttributeValueRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		if ($this->name === null) {
			throw new BuilderException('Property [name] is required.');
		}
		$instance->name = $this->name;
		if ($this->value === null) {
			throw new BuilderException('Property [value] is required.');
		}
		$instance->value = $this->value;
		return $instance;
	}