Creates manipulation instance

@param string $operation Operation name

@return mixed
183284
public function create($operation)
    {
        if (!is_string($operation)) {
            throw new \LogicException("Provided manipulation name {$operation} is not a string!");
        }

        $operation = str_replace('-', ' ', $operation);
        $operation = strtolower($operation);
        $operation = ucwords($operation);
        $operation = str_replace(' ', '', $operation);

        $className = "Todstoychev\\Icr\\Manipulator\\" . $operation;

        if (!class_exists($className)) {
            throw new IcrRuntimeException("Operation {$operation} does not exists!");
        }

        return new $className($this->box, $this->point);
    }
741599
protected function getOperationHandler(LdapOperationInterface $operation)
    {
        foreach ($this->handler as $handler) {
            if ($handler->supports($operation)) {
                $handler->setConnection($this->connection);
                $handler->setEventDispatcher($this->dispatcher);

                return $handler;
            }
        }

        throw new LdapConnectionException(sprintf(
            'Operation "%s" with a class name "%s" does not have a supported operation handler.',
            $operation->getName(),
            get_class($operation)
        ));
    }
272255
public static function parseOperationName(Operation $operation)
    {
        $verb = self::deriveAction($operation->httpMethod, $operation->uri);

        $wordifiedPath = self::wordifyPath($operation->uri);

        if ($operation->version == 'stream') {
            $wordifiedPath = $wordifiedPath.'Stream';
        }

        if (preg_match("/^\/{urlname}.*/", $operation->uri) == 1) {
            $wordifiedPath = 'Group'.$wordifiedPath;
        }

        return ucfirst($verb.$wordifiedPath);
    }
485227
public function create($operator, $value)
    {
        $this->operator = $operator;
        $this->value    = $value;

        return $this;
    }
1350868
public function batch(string $operation)
    {
        $this->request->allowMethod(['post']);

        $table = $this->loadModel();
        Assert::isInstanceOf($table, Table::class);

        $redirectUrl = $this->getBatchRedirectUrl();

        $batchIds = (array)$this->request->getData('batch.ids');
        if (empty($batchIds)) {
            $this->Flash->error((string)__('No records selected.'));

            return $this->redirect($redirectUrl);
        }

        $batchIdsCount = count($batchIds);

        // broadcast batch ids event
        $event = new Event((string)EventName::BATCH_IDS(), $this, [
            $batchIds,
            $operation,
            $this->Auth->user()
        ]);
        $this->getEventManager()->dispatch($event);

        $batchIds = is_array($event->result) ? $event->result : $batchIds;

        if (empty($batchIds)) {
            $operation = strtolower(Inflector::humanize($operation));
            $this->Flash->error((string)__('Insufficient permissions to ' . $operation . ' the selected records.'));

            return $this->redirect($redirectUrl);
        }

        if ('delete' === $operation) {
            $primaryKey = $table->getPrimaryKey();
            if (! is_string($primaryKey)) {
                throw new UnsupportedPrimaryKeyException();
            }

            $conditions = [$primaryKey . ' IN' => $batchIds];
            // execute batch delete
            if ($table->deleteAll($conditions)) {
                $this->Flash->success(
                    (string)__(count($batchIds) . ' of ' . $batchIdsCount . ' selected records have been deleted.')
                );
            } else {
                $this->Flash->error((string)__('Selected records could not be deleted. Please, try again.'));
            }

            return $this->redirect($redirectUrl);
        }

        if ('edit' === $operation && (bool)$this->request->getData('batch.execute')) {
            $fields = (array)$this->request->getData($this->name);
            if (empty($fields)) {
                $this->Flash->error((string)__('Selected records could not be updated. No changes provided.'));

                return $this->redirect($redirectUrl);
            }

            $primaryKey = $table->getPrimaryKey();
            if (! is_string($primaryKey)) {
                throw new UnsupportedPrimaryKeyException();
            }

            $conditions = [$primaryKey . ' IN' => $batchIds];
            // execute batch edit
            if ($table->updateAll($fields, $conditions)) {
                $this->Flash->success(
                    (string)__(count($batchIds) . ' of ' . $batchIdsCount . ' selected records have been updated.')
                );
            } else {
                $this->Flash->error((string)__('Selected records could not be updated. Please, try again.'));
            }

            return $this->redirect($redirectUrl);
        }

        $this->set('entity', $table->newEntity());
        $this->set('fields', Field::getCsvView($table, $operation, true, true));
        $this->render('CsvMigrations.Common/batch');
    }
309455
protected function prepareOperator($parameter, string $operator): string
    {
        if (!$parameter instanceof ParameterInterface) {
            //Probably fragment
            return $operator;
        }

        if ($parameter->getType() == \PDO::PARAM_NULL) {
            switch ($operator) {
                case '=':
                    return 'IS';
                case '!=':
                    return 'IS NOT';
            }
        }

        return parent::prepareOperator($parameter, $operator);
    }
162843
public static function getImiCmd($toolName, $operation, $args = [])
    {
        if(isset($_SERVER['_']) && $_SERVER['SCRIPT_FILENAME'] === $_SERVER['_'])
        {
            $cmd = $_SERVER['_'];
        }
        else
        {
            $cmd = ($_SERVER['_'] ?? 'php') . ' ' . $_SERVER['argv'][0];
        }
        $cmd .= ' ' . $toolName . '/' . $operation;
        if(null !== ($appNamespace = Args::get('appNamespace')))
        {
            $cmd .= ' -appNamespace "' . $appNamespace . '"';
        }
        foreach($args as $k => $v)
        {
            if(is_numeric($k))
            {
                $cmd .= ' -' . $v;
            }
            else
            {
                $cmd .= ' -' . $k . ' "' . $v . '"';
            }
        }
        return $cmd;
    }
876182
function getOperationData($operation){
		if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
			$this->loadWSDL();
			if ($this->getError())
				return false;
		}
		if(isset($this->operations[$operation])){
			return $this->operations[$operation];
		}
		$this->debug("No data for operation: $operation");
	}
150132
protected function prepareOperator($parameter, string $operator): string
    {
        if (!$parameter instanceof ParameterInterface) {
            //Probably fragment
            return $operator;
        }

        if ($operator != '=' || is_scalar($parameter->getValue())) {
            //Doing nothing for non equal operators
            return $operator;
        }

        if ($parameter->isArray()) {
            //Automatically switching between equal and IN
            return 'IN';
        }

        return $operator;
    }
54927
public function addOperation(OperationInterface $operation)
    {
        $this->operations[$operation->getName()] = $operation->setServiceDescription($this);

        return $this;
    }
1350176
public function addOperation(OperationInterface $operation)
    {
        if (!$this->operations->contains($operation)) {
            $this->operations->add($operation);
        }

        return $this;
    }
587307
private function prepareOperations(array $operations)
    {
        foreach ($operations as $operation => &$config) {
            $config['uri'] = ltrim($config['url'], '/');
            unset($config['url']);

            $config['httpMethod'] = strtoupper($config['method']);
            unset($config['method']);
            if (strpos($config['httpMethod'], '/') !== false) {
                $config['httpMethod'] = explode('/', $config['httpMethod'])[0];
            }

            if (isset($config['responseTypes']) && count($config['responseTypes']) === 1) {
                $class = ucwords($config['resource']).'\\';
                $class .= str_replace(' ', '', ucwords($config['responseTypes'][0]['name']));

                $config['responseModel'] = $class;
            } else {
                $config['responseModel'] = 'getResponse';
            }

            if (isset($config['parametersArray']) && $config['parametersArray']) {
                $config['type'] = 'array';
            }
            unset($config['parametersArray']);

            foreach ($config['parameters'] as $parameter => &$parameterConfig) {
                $this->updateParameterTypes($parameterConfig);
                if (!isset($parameterConfig['required'])) {
                    $parameterConfig['required'] = false;
                }
            }
        }

        return $operations;
    }
340040
public function queue($operation, $args = null, $options = [])
	{
		$command = $this->_prepareCommand($operation, $args);
		return $this->broker->queue($command, $options);
	}
730197
public function addOperation(Operation $operation)
    {
        $id = $operation->getMethod() . $operation->getPath();

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

        $this[$id] = $operation;

        return $this;
    }
578645
public function process($src, OperationInterface $operation)
    {
        $field = $operation->getField();
        $order = $operation->getOrder();
        $src->order .= "ORDER BY $field $order";
        return $src;
    }
111070
public function stream_lock($operation)
    {
        $operation = (int) $operation;

        if (($operation & \LOCK_UN) === \LOCK_UN) {
            return $this->releaseLock($operation);
        }

        // If the caller calls flock() twice, there's no reason to re-create the
        // lock handle.
        if (is_resource($this->lockHandle)) {
            return flock($this->lockHandle, $operation);
        }

        $this->lockHandle = $this->openLockHandle();

        return is_resource($this->lockHandle) && flock($this->lockHandle, $operation);
    }
1192489
private function runOperation(Operation $operation)
    {
        try {
            return $this->runner->run($operation);
        } catch (\Throwable $e) {
            // treated below
        } catch (\Exception $e) {
            // treated below
        }

        // @todo keep only inner if once ExceptionCatcher is gone
        if ($this->exceptionCatcherVoter instanceof ThrowableCatcherVoter) {
            if (!$this->exceptionCatcherVoter->shouldCatchThrowable($e)) {
                throw $e;
            }
        } elseif (!$this->exceptionCatcherVoter->shouldCatch($e)) {
            throw $e;
        }

        try {
            $this->waitStrategy->wait();
        } catch (WaiterException $waiterException) {
            throw $e;
        }

        return $this->runOperation($operation);
    }