This is called for each interaction received from the stream and must
be implemented in extending classes.

@param array $interaction The interaction data structure
@param bool  $hash

@return void
962278
protected function onInteraction($interaction, $hash = false)
    {
        $this->_eventHandler->onInteraction($this, $interaction, $hash);
    }
940706
public function takeNoticeOfRemovedInteraction(Interaction $interaction, Item $item){
        $irpExisted = false;
        foreach($this->components as $key => $irp){
            if($irp->getResponse() === $interaction->getResponse()){
                unset($this->components[$key]);
                $irpExisted = true;
                break;
            }
        }
        if(!$irpExisted){
            common_Logger::w('InstanceResponseProcessing not found for removed interaction '.$interaction->getIdentifier(), array('TAOITEMS', 'QTI'));
        }
    }
212740
protected function deletePasswordRequestData($hash) 
    {
        $table = $this->getServiceLocator()->get('MelisLostPasswordTable');
        $data = $this->getPasswordRequestData($hash);
        
        if($data)
            $table->deleteByField('rh_hash', $hash);
    }
629277
public function setHash($hash)
    {
      if(!is_string($hash) || strlen(trim($hash)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid hash, must be a non empty string');

      $this->hash = $hash;
    }
1085945
public function addDependency($fromHash, $toHash)
    {
        $definition = $this->nodeList[$fromHash];

        $definition->dependencyList[] = $toHash;
    }
513000
public function interactWith(
        FormInterface $form,
        HelperSet $helperSet,
        InputInterface $input,
        OutputInterface $output
    ) {
        if (FormUtil::isTypeInAncestry($form, ButtonType::class)) {
            throw new NoNeedToInteractWithForm();
        }

        // by default, we let another interactor interact with this form
        throw new CanNotInteractWithForm();
    }
652143
public function stashApply(string $stash, bool $index = false)
    {
        $stashCommand = StashCommand::getInstance($this);
        $command = $stashCommand->apply($stash, $index);
        $this->caller->execute($command);
    }
331612
public function init()
    {
        parent::init();
        self::$plugin = $this;
        $this->setComponents([
            'collision' => \marionnewlevant\snitch\services\Collision::class,
        ]);
        if (Craft::$app->getRequest()->getIsCpRequest() && !Craft::$app->getUser()->getIsGuest() && !Craft::$app->getRequest()->getIsAjax()) {
            // Register our asset bundle
            Craft::$app->getView()->registerAssetBundle(SnitchAsset::class);
            // on save, remove any collision for this element.
            Event::on(Elements::class, Elements::EVENT_AFTER_SAVE_ELEMENT, function(ElementEvent $event) {
                $elementId = $event->element->id;
                $this->collision->remove($elementId);
            });
        }
    }
441914
public function interactInstallDrupal(
    InputInterface $input,
    OutputInterface $output,
    AnnotationData $annotationData
  ) {
    /** @var \Acquia\Blt\Robo\Wizards\SetupWizard $setup_wizard */
    $setup_wizard = $this->getContainer()->get(SetupWizard::class);
    $setup_wizard->wizardInstallDrupal();
  }
168954
protected function interact(Input $input, Output $output) {
        return $this->cmd->interact($input,$output);
    }
22943
protected function interact(InputInterface $input, OutputInterface $output)
    {
        parent::interact($input, $output);

        // Fill up questions
        if (Context::get('information-collector')->hasMissingInformation()) {
            $questions = Context::get('information-collector')->getInteractiveQuestions();
            $this->getOutput()->writeSmallTitle('Information collect ('.count($questions).' questions)');
            $this->getOutput()->indent();
            $count = 1;
            foreach ($questions as $name => $question) {
                $answer = $this->getOutput()->askQuestion($question, $count++, $this->input);
                Context::get('information-collector')->setValueFor($name, $answer);
                $this->getOutput()->writeEmptyLine();
            }
            $this->getOutput()->unIndent();
        }
    }
1211986
public function transaction(Transaction $transaction): void
	{
		if ($this->config->gaClientId) {
			$data = new ArrayHash;
			$data->transaction_id = $transaction->id;
			if ($transaction->affiliation !== null) {
				$data->affiliation = $transaction->affiliation;
			}
			if ($transaction->value !== null) {
				$data->value = $transaction->value;
			}
			if ($transaction->currency !== null) {
				$data->currency = $transaction->currency;
			}
			if ($transaction->tax !== null) {
				$data->tax = $transaction->tax;
			}
			if ($transaction->shipping !== null) {
				$data->shipping = $transaction->shipping;
			}
			$data->items = [];
			foreach ($transaction->items as $item) {
				$itemData = new ArrayHash;
				$itemData->id = $item->id;
				$itemData->name = $item->name;
				if ($item->category !== null) {
					$itemData->category = $item->category;
				}
				if ($item->quantity !== null) {
					$itemData->quantity = $item->quantity;
				}
				if ($item->price !== null) {
					$itemData->price = $item->price;
				}
				$data->items[] = $itemData;
			}

			$this->event('purchase',
				$this->config->gaClientId,
				$data);
		}
	}
572740
public function start($hash = false, $name = false)
    {
        if ($hash) {
            $this->_hash = $hash;
        }

        if ($name) {
            $this->_name = $name;
        }

        if (! empty($this->_id)) {
            $this->restart();
        } else {
            $this->create();
        }
    }
523186
public function finalizeUpload(string $hash, ?string $context = null): bool
    {
        $this->init();
        $entity = $this->repository->findByHash($hash, $context, false);
        if ($entity) {
            $entity->setConfirmed(true);
            $entity->setSize(strlen($entity->getContents()));
            $this->manager->persist($entity);
            $this->manager->flush();
            return true;
        }
        return false;
    }
913735
public function interactConfigureBehat(
    InputInterface $input,
    OutputInterface $output,
    AnnotationData $annotationData
  ) {
    /** @var \Acquia\Blt\Robo\Wizards\TestsWizard $tests_wizard */
    $tests_wizard = $this->getContainer()->get(TestsWizard::class);
    $tests_wizard->wizardConfigureBehat();
  }
146483
public function addInteraction(Interaction $interaction, $body){
        $returnValue = false;

        if(!is_null($interaction)){
            $returnValue = $this->getBody()->setElement($interaction, $body);
        }

        return (bool) $returnValue;
    }
1242477
function(options)
	{
		// If this Hash has an external source, ensure it's kept up-to-date
		if (options.source)
		{
			var changeHandler = function(event)
			{
				options.source[event.property] = event.value;
			};

			this.addEventListener('change', changeHandler, this);
		}

		conbo.assign(this, conbo.setDefaults({}, options.source, this._defaults));
		delete this._defaults;
	}