Add an operation that should be executed after this operation.

@param LdapOperationInterface[] ...$operations
@return $this
485835
public function addPostOperation(LdapOperationInterface ...$operations)
    {
        foreach ($operations as $operation) {
            $this->postOperations[] = $operation;
        }

        return $this;
    }
1068498
public function setOperation(\CampaignChain\CoreBundle\Entity\Operation $operation)
    {
        $this->operation = $operation;

        return $this;
    }
1300471
public function addOrders(array $orders)
    {
        foreach ($orders as $key => $order) {
            $this->addOrder($order);

            /** Name the expression if $key is a non-numeric string. */
            if (is_string($key) && !is_numeric($key)) {
                $order = end($this->orders);
                $order->setName($key);
            }
        }

        return $this;
    }
1045053
public function addOperation(Operation $operation)
    {
        $this->operations[$operation->name] = $operation;
        ksort($this->operations);
    }
65008
public function union($dals) {
		if(!is_array($dals))
			$dals = [$dals];
		$this->unions = array_merge($this->unions, $dals);

		return $this;
	}
81668
public function add(BaseOperator ...$operators)
    {
        foreach ($operators as $operator) {
            if ($operator instanceof bAnd) {
                $this->operators['and'][] = $operator;
            } elseif ($operator instanceof bOr) {
                $this->operators['or'][] = $operator;
            } elseif ($operator instanceof bNot) {
                $this->operators['not'][] = $operator;
            } elseif ($operator instanceof Wildcard) {
                $this->operators['wildcard'][] = $operator;
            } elseif ($operator instanceof MatchingRule) {
                $this->operators['matchingrule'][] = $operator;
            } elseif ($operator instanceof Comparison) {
                $this->operators['comparison'][] = $operator;
            } else {
                throw new InvalidArgumentException('Unknown operator type.');
            }
        }
        
        return $this;
    }
1085015
public function removeOperation($operation)
    {
        if (in_array($operation, $this->operations, true)) {
            $key = array_search($operation, $this->operations, true);
            unset($this->operations[$key]);
        }
    }
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));
        }
    }
524595
public function addPrices($prices, $operation = self::ADD)
    {
        if (!is_array($prices) && !$prices instanceof Traversable) {
            throw new InvalidArgumentException("prices must be iterable");
        }

        foreach ($prices as $price) {
            if (!$price instanceof Price) {
                throw new InvalidArgumentException("elements of prices must be instance of Price");
            }
            $this->addPrice($price, $operation);
        }

        return $this;
    }
501524
private function appendResponses(Operation $operation, array $newResponses)
    {
        foreach ($newResponses as $newResponse) {
            if (!$operation->responses) {
                $operation->responses = [];
            }

            $hasResponse = false;

            /** @var Response $response */
            foreach ($operation->responses as $response) {
                // check if one has already been set. If so, skip it.
                if ($response->response == $newResponse->response) {
                    $hasResponse = true;
                }
            }

            if (!$hasResponse) {
                $operation->responses[] = $newResponse;
            }
        }
    }
1186993
protected function runOperations() {
		foreach( $this->operations as $operation ) {
			$operation->setTransactionOperationSet($this);
			$operation->runIfValid();
		}
	}
836089
public void addOperations(final Map<MemcachedNode, Operation> ops) {
    for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) {
      addOperation(me.getKey(), me.getValue());
    }
  }
958525
public function operation($operation)
    {
        $existing = $this->operations->findByIdentifier($operation);

        if ($existing) {
            return $existing;
        }

        $scaffoldClass = OperationScaffolder::getClassFromIdentifier($operation);
        if (!$scaffoldClass) {
            throw new InvalidArgumentException(
                sprintf(
                    'Invalid operation: %s added to %s',
                    $operation,
                    $this->getDataObjectClass()
                )
            );
        }
        /**
         * @var OperationScaffolder $scaffolder
         */
        $scaffolder = Injector::inst()->createWithArgs($scaffoldClass, [$this->getDataObjectClass()]);

        $this->operations->push(
            $scaffolder->setChainableParent($this)
        );

        return $scaffolder;
    }
1218484
public function insertAfter($targets) {
    foreach ($this->nodes as $node) {
      $node->insertAfter($targets);
    }
    return $this;
  }
540082
public function addOperator(string $operator): self
    {
        $this->validateOperator($operator);
        if (!in_array($operator, $this->operators)) {
            $this->operators[] = $operator;
        }

        return $this;
    }
998839
protected function resetLdapControls(LdapOperationInterface $operation)
    {
        foreach ($operation->getControls() as $control) {
            $value = $control->getValue();
            $control->setValue($control->getResetValue());
            $this->connection->setControl($control);
            $control->setValue($value);
        }
    }
184397
public function setOperators(array $operators): self
    {
        foreach ($operators as $operator) {
            $this->validateOperator($operator);
        }
        $this->operators = $operators;

        return $this;
    }