Add pending document abstract action
@param string $actionType
@param array $data
@return mixed
480937
public function action($actionType, $data = [])
    {

        $this->body["body"][] = [

            $actionType => [
                '_index' => $this->getIndex(),
                '_type' => $this->getType(),
                '_id' => $this->_id
            ]

        ];

        if (!empty($data)) {
            if($actionType == "update"){
                $this->body["body"][] = ["doc" => $data];
            }else {
                $this->body["body"][] = $data;
            }
        }

        $this->operationCount++;

        $this->reset();

        if ($this->autocommitAfter > 0 && $this->operationCount >= $this->autocommitAfter) {
            return $this->commit();
        }

        return true;
    }
677734
private function resolveActionType(Action\ActionTypeInterface $type)
    {
        $typeExtensions = [];
        $parentType = $type->getParent();
        $class = get_class($type);

        foreach ($this->extensions as $extension) {
            $typeExtensions = array_merge(
                $typeExtensions,
                $extension->getActionTypeExtensions($class)
            );
        }

        return $this->resolvedTypeFactory->createResolvedActionType(
            $type,
            $typeExtensions,
            $parentType ? $this->getActionType($parentType) : null
        );
    }
398845
public function log($type = null, $data = [])
    {
        if (!func_num_args()) {
            return $this->_log;
        }
        $this->report($type, $this->log()->add($type, $data));
    }
1213512
public function doTrackAction($actionUrl, $actionType)
    {
        // Referrer could be udpated to be the current URL temporarily (to mimic JS behavior)
        $url = $this->getUrlTrackAction($actionUrl, $actionType);

        return $this->sendRequest($url);
    }
167805
public function addFiles(array $data, string $contentType = 'application/octet-stream') {
        foreach ($data as $key => $value) {
            $this->addFile($key, $value, $contentType);
        }
    }
304288
public function handleAlterAction($actionName, $arguments, $data)
    {
        $actionName = strtolower($actionName);

        foreach ($this->getComponents() as $component) {
            if ($component instanceof GridField_ActionProvider) {
                $actions = array_map('strtolower', (array) $component->getActions($this));

                if (in_array($actionName, $actions)) {
                    return $component->handleAction($this, $actionName, $arguments, $data);
                }
            }
        }

        throw new InvalidArgumentException(sprintf(
            'Can\'t handle action "%s"',
            $actionName
        ));
    }
1020530
public function addIntegration($type, array $data = [])
    {
        $body = ['type' => $type] + $data;

        return Integration::create($body, $this->getLink('integrations'), $this->client);
    }
321187
public function buildAction($pipeline, $actionName, $actionConfiguration = [])
    {
        $triggeredByEvents = is_array($actionConfiguration) && array_key_exists("triggered_by_events", $actionConfiguration) ? $actionConfiguration["triggered_by_events"] : [];

        if (empty($triggeredByEvents)) {
            // default behavior : auto-wiring action to the same event name
            $triggeredByEvents = [$actionName];
        }

        // create the action and the action creator
        $action = new Action($actionName);
        $actionCreator = new ActionCreator($action);
        foreach ($triggeredByEvents as $triggeredByEvent) {
            $event = $pipeline->hasIncomingEvent($triggeredByEvent) ? $pipeline->getIncomingEvent($triggeredByEvent) : new Event($triggeredByEvent);
            $actionCreator->addTriggeredByEvent($event);
            $pipeline->addIncomingEvent($event);
        }
        $pipeline->addAction($action);
        $pipeline->addActionCreator($actionCreator);
    }
8436
function doaction(type, data) {
		if (gui.hosted) {
			gui.Action.ascendGlobal(document, type, data);
		}
	}
1218027
public function action($contentTypeName, array $changeRequest)
    {
        foreach ($changeRequest as $recordId => $actionData) {
            if ($actionData === null) {
                continue;
            }

            $repo = $this->em->getRepository($contentTypeName);
            foreach ($actionData as $action => $fieldData) {
                if (!$entity = $repo->find($recordId)) {
                    continue;
                }
                $this->modifyContentTypeRecord($repo, $entity, $action, $fieldData);
            }
        }
    }
1207688
public function addActions(array $actions): self
    {
        foreach ($actions as $action) {
            $this->addAction($action);
        }

        return $this;
    }
503457
public function setActionType($action_type)
    {
        $allowedValues = $this->getActionTypeAllowableValues();
        if (!in_array($action_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'action_type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['action_type'] = $action_type;

        return $this;
    }
492420
public function writeTypedObject($data)
    {
        $this->_stream->writeUTF($this->_className);
        $this->writeObject($data);
        return $this;
    }
993003
public function add($productId, $resource, $resourceType, $store = null, $identifierType = null)
    {
        return $this->__createAction('product_downloadable_link.add', func_get_args());
    }
877353
protected function getActions($actionType, \DateTime $periodStart, \DateTime $periodEnd)
    {
        switch ($actionType) {
            case Action::TYPE_OPERATION:
                return $this->em
                    ->getRepository('CampaignChainCoreBundle:Operation')
                    ->getScheduledOperation($periodStart, $periodEnd);

            case Action::TYPE_ACTIVITY:
                return $this->em
                    ->getRepository('CampaignChainCoreBundle:Activity')
                    ->getScheduledActivity($periodStart, $periodEnd);

            case Action::TYPE_MILESTONE:
                return $this->em
                    ->getRepository('CampaignChainCoreBundle:Milestone')
                    ->getScheduledMilestone($periodStart, $periodEnd);

            case Action::TYPE_CAMPAIGN:
                return $this->em
                    ->getRepository('CampaignChainCoreBundle:Campaign')
                    ->getScheduledCampaign($periodStart, $periodEnd);

            default:
                throw new \LogicException('Wrong action type: '.$actionType);
        }
    }
767203
public function addFields(array $data, string $contentType = 'text/plain') {
        foreach ($data as $key => $value) {
            $this->addField($key, $value, $contentType);
        }
    }
906817
public function update(array $data)
    {
        $this->manager->postPendingQuery(
            new PendingQuery(
                $this->entity,
                PendingQuery::TYPE_UPDATE,
                $this->getUpdateQuery($data),
                $this->parameters
            )
        );
    }