Sets client side confirm for operation.
@param string $operation
@param string $message
@return Operation
493441
public function setConfirm($operation, $message)
    {
        $message = $this->translate($message);
        $this->grid->onRender[] = function(Grid $grid) use ($operation, $message) {
            $grid['form'][Operation::ID][Operation::ID]->getControlPrototype()->setAttribute(
                "data-grido-confirm-$operation", $message
            );
        };

        return $this;
    }
906162
protected function executeOperation(LdapOperationInterface $operation, LogOperation $log = null)
    {
        $lastServer = $this->connection->getServer();
        try {
            $this->connectIfNotBound($operation);
            $lastServer = $this->connection->getServer();
            $handler = $this->getOperationHandler($operation);
            $handler->setOperationDefaults($operation);
            $this->logStart($log);
            $this->invalidateCacheIfNeeded($operation);
            list($result, $usedCache, $cacheKey) = $this->getCacheOrHandlerResult($operation, $handler, $log);
            $this->cacheResultIfNeeded($operation, $result, $usedCache, $cacheKey);

            return $result;
        } catch (\Throwable $e) {
            $this->logExceptionAndThrow($e, $log);
        } catch (\Exception $e) {
            $this->logExceptionAndThrow($e, $log);
        } finally {
            $this->logEnd($log);
            // It would not have set controls or switched servers if the cache was used...
            if (isset($usedCache) && $usedCache === false) {
                $this->resetLdapControls($operation);
                $this->switchServerIfNeeded($this->connection->getServer(), $lastServer, $operation);
            }
            $this->dispatcher->dispatch(new LdapOperationEvent(Event::LDAP_OPERATION_EXECUTE_AFTER, $operation, $this->connection));
        }
    }
98694
private function operationUpdatesContact($operation)
    {
        if (isset($operation->response)) {
            foreach (['headers', 'body'] as $fieldType) {
                if (is_array($operation->response->{$fieldType})) {
                    foreach ($operation->response->{$fieldType} as $field) {
                        if (
                            isset($field->destination)
                            && '' !== $field->destination
                        ) {
                            return true;
                        }
                    }
                }
            }
        }

        return false;
    }
345358
public function setCode($code, $message)
    {
        $this->message = $message;
        $this->code    = (int)$code;

        return $this;
    }
373231
private function runOperation(PromiseOperation $operation)
    {
        $promise = $operation->getPromise();

        return $promise->then(
            $this->onTerminate($operation, $this->fulfilledVoter, true, $promise),
            $this->onTerminate($operation, $this->rejectedVoter, false, $promise)
        );
    }
846633
public function confirmation($message, $choices = ['y' => true, 'n' => false], $default = false)
    {
        $message = is_array($message) ? call_user_func_array('sprintf', $message) : $message;

        $answers = [];
        foreach ($choices as $answer => $value) {
            $answers[$answer] = $answer;
            if ($value === $default) $answers[$answer] = ucfirst($answer);
        }
        
        $this->send(sprintf('%s [%s]: ', $message, join('/', $answers)), '');
        $answer = $this->readline();
        if ($answer === '') return $default;

        if (array_key_exists($answer, $choices)) {
            return $choices[$answer];
        } else {
            foreach ($choices as $key => $value) {
                if ($answer === substr($key, 0, strlen($answer))) return $value;
            }
            return $default;
        }
    }
109770
public function set_message($rule, $message)
	{
		if ($message !== null)
		{
			$this->error_messages[$rule] = $message;
		}
		else
		{
			unset($this->error_messages[$rule]);
		}

		return $this;
	}
1321121
protected function operate($info, $status, $time, $operate, $server)
    {
        if (!isset(static::$operate[$operate])) {
            static::$operate[$operate] = [0, 0];
        }
        if (!isset(static::$servers[$server])) {
            static::$servers[$server] = [0, 0];
        }

        static::$operate[$operate][0]++;
        static::$operate[$operate][1] += $time;

        static::$servers[$server][0]++;
        static::$servers[$server][1] += $time;

        $this->statistics();
        if ($status) {
            $status = '; success';
        } else {
            $status = '; <font style="color:red">failed</font>';
        }
        $this->Debug->append('执行明细', $info . $this->getSubInfo($time, $status));
    }
548575
private function toProcess($entity, $operation)
    {
        switch ($operation) {
            case self::ENCRYPT:
                return !$entity->isEncrypted();
            case self::DECRYPT:
                return $entity->isEncrypted();
            default:
                return false;
        }
    }
1266896
public function setCondition($field_name, $value, $operation = '=')
    {
        $this->condition[$field_name] = [
            'value' => $value,
            'operation' => $operation
        ];

        return $this;
    }
99669
public function ExecuteRequest($operation, $params = array())
	{
		$params = array_replace($this->GetWSInitialRequest($operation), $params); 

		$results = parent::ExecuteRequest($operation, $params);

		$this->_CheckErrors($operation, $results);

		return $results->{$operation.'Result'};
	}
1353925
public function setStatus($status, $calledFromOperation = false)
    {
        parent::setStatus($status);

        // Change the Operation as well only if this method has not been called by an Operation instance to avoid recursion.
        if (!$calledFromOperation && $this->getEqualsOperation() && count($this->getOperations())) {
            $this->getOperations()[0]->setStatus($this->status, true);
        }

        return $this;
    }
730197
public function addOperation(Operation $operation)
    {
        $id = $operation->getMethod() . $operation->getPath();

        if ($operation->getOperation()->getOperationId()) {
            $id = $operation->getOperation()->getOperationId();
        }

        $this[$id] = $operation;

        return $this;
    }
484878
public function setStatusMessage($message)
    {
        if($row = $this->getIterator()->current()) {
            $row->setStatusMessage($message);
        }

        return $this;
    }
362099
public function confirmToProceed($warning = 'Application In Production!', Closure $callback = null)
    {
        $shouldConfirm = $callback ?: $this->getDefaultConfirmCallback();

        if (call_user_func($shouldConfirm))
        {
            if ($this->option('force')) return true;

            $this->comment(str_repeat('*', strlen($warning) + 12));
            $this->comment('*     '.$warning.'     *');
            $this->comment(str_repeat('*', strlen($warning) + 12));
            $this->output->writeln('');

            $confirmed = $this->confirm('Do you really wish to run this command?');

            if (! $confirmed) {
                $this->comment('Command Cancelled!');

                return false;
            }
        }

        return true;
    }
1160533
public function confirm($string, $verbosity = null, $default = true, array $args = [])
    {
        $message    =   $this->interpolate($string, $args);
        return parent::confirm($message, $default);
    }
950340
public function setMessage($message)
    {
        if ( ! is_null($message)) $message = (string) $message;

        $this->setAttribute('message', $message);

        return $this;
    }