Fills the commit with related issues matched by CommitMatcher.

@param \Kreta\Component\VCS\Event\NewCommitEvent $event The new commit event
499116
public function newCommit(NewCommitEvent $event)
    {
        $commit = $event->getCommit();

        $related = $this->matcher->getRelatedIssues($commit);
        $commit->setIssuesRelated($related);

        $this->repository->persist($commit);
    }
520677
public function afterCommit(TransactionEvent $event) {
    if ($event->getPhase() == TransactionEvent::AFTER_COMMIT) {
      $response = $this->getResponse();
      $locationOid = $response->getHeader('Location');

      // replace changed oids
      $changedOids = $event->getInsertedOids();
      foreach ($changedOids as $oldOid => $newOid) {
        if ($response->hasValue($oldOid)) {
          $value = $response->getValue($oldOid);
          $response->setValue($newOid, $value);
          $response->clearValue($oldOid);
        }
        if ($locationOid == $oldOid) {
          $this->setLocationHeaderFromOid($newOid);
        }
      }
    }
  }
375158
public function add($event) {
        $event->setParent($this->_parent);
        $this->_events[$event->getName()] = $event;
    }
849042
public function apply($event): void
    {
        $this->handleRecursively($event);

        ++$this->playhead;
        $this->uncommittedEvents[] = DomainMessage::recordNow(
            $this->getAggregateRootId(),
            $this->playhead,
            new Metadata([]),
            $event
        );
    }
121797
public function afterPrepare(Event $event)
	{
		$command = $event['command'];
		$operation = $command->getOperation();

		if ($command->offsetExists('_kmd')) $command->offsetUnset('_kmd');
		if ($command->offsetExists('_acl')) $command->offsetUnset('_acl');

		if ($operation->getName() !== 'createEntity' && $command->offsetGet('collection') === 'user')
		{
			// These values should never be passed to Kinvey on a user update operation.
			if ($command->offsetExists('username')) $command->offsetUnset('username');
			if ($command->offsetExists('password')) $command->offsetUnset('password');
			if ($command->offsetExists('salt')) $command->offsetUnset('salt');
		}
	}
938211
protected function fireConnectionEvent( $event )
	{
		if ( !isset( $this->events ) )
		{
			return;
		}

		switch ( $event )
		{
			case 'beganTransaction':
				return $this->events->fire( new Events\TransactionBeginning( $this ) );
			case 'committed':
				return $this->events->fire( new Events\TransactionCommitted( $this ) );
			case 'rollingBack':
				return $this->events->fire( new Events\TransactionRolledBack( $this ) );
		}
	}
770285
public function afterCommit(TransactionEvent $event) {
    if ($event->getPhase() == TransactionEvent::AFTER_COMMIT) {
      // remove temporary permissions
      $permissionManager = $this->getPermissionManager();
      foreach ($this->tempPermissions as $permission) {
        $permissionManager->removeTempPermission($permission);
      }
    }
  }
1011092
final private function replayChange(Event $event)
    {
        $this->apply($event->payload());
        $this->lastCommittedEventSequenceNumber = $event->sequenceNumber();
    }
788437
public function startup($event)
    {
        // startup-event
        $_event = new Event('Component.Manager.startup', $this, [
        ]);
        $this->Controller->eventManager()->dispatch($_event);

        if ($this->isPrefix()) {
            $this->_runCallback("startup", $event);

            // startup-event with Prefix
            $this->_runEvent("startup");
        }
    }
532339
public function onPostUpdateCmd(Event $event)
    {
        $this->bridgeFactory->createBridge($event->getIO())
            ->update($event->getComposer());
    }
557110
public function onBeforeDeleteLanguageCommit(BeforeDeleteLanguageCommitEvent $event)
    {
        if ($event->isAborted()) {
            return;
        }

        $this->languageManager = $event->getContentManager();
        $languageRepository = $this->languageManager->getLanguageRepository();

        $this->sourceObjects = $this->setUpSourceObjects();
        if (null === $this->sourceObjects) {
            return;
        }

        if (count($this->sourceObjects) > 0) {
            try {
                $result = true;
                $languageRepository->startTransaction();
                foreach ($this->sourceObjects as $sourceObject) {
                    $result = $this->delete($sourceObject);
                    if (!$result) {
                        break;
                    }
                }

                if (false !== $result) {
                    $languageRepository->commit();
                } else {
                    $languageRepository->rollBack();

                    $event->abort();
                }
            } catch (\Exception $e) {
                $event->abort();
                if (isset($languageRepository) && $languageRepository !== null) {
                    $languageRepository->rollBack();
                }

                throw $e;
            }
        }
    }
5554
public function afterDelete($event)
    {
        if (!$this->enableAuditField) {
            parent::afterDelete($event);
            return;
        }

        $date = time();
        $auditModels = $this->getAuditModels();
        $auditRequestId = $this->getAuditRequestId();
        $userId = Yii::app()->user && Yii::app()->user->id ? Yii::app()->user->id : 0;
        $auditFields = array();

        // prepare the logs
        $pk = $this->getModelPrimaryKeyString($this->auditModel);
        foreach ($auditModels as $auditModel) {
            $prefix = isset($auditModel['prefix']) ? $auditModel['prefix'] . '.' . $pk : '';
            $auditFields[] = array(
                'old_value' => '',
                'new_value' => '',
                'action' => 'DELETE',
                'model_name' => $auditModel['model_name'],
                'model_id' => $auditModel['model_id'],
                'field' => $prefix . '*',
                'created' => $date,
                'user_id' => $userId,
                'audit_request_id' => $auditRequestId,
            );
        }

        // insert the audit_field records
        $this->addAuditFields($auditFields);

        parent::afterDelete($event);
    }
256713
public function addEvent(Event $event)
    {
        $this->clear();
        $this->events[$event->getName()] = $event;

        return $this;
    }
992524
public function onNewCodeEvent(Event $event)
    {
        $vendorDir   = $event->getComposer()->getConfig()->get('vendor-dir');
        $projectDir  = dirname($vendorDir);
        $phpStormDir = $projectDir . DIRECTORY_SEPARATOR . '.idea';
        $filesDir    = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'files';

        if (is_dir($phpStormDir) && is_dir($filesDir)) {
            $this->patcher->patch(
                new Environment(
                    new Filesystem($phpStormDir),
                    new Filesystem($filesDir),
                    new Filesystem($projectDir),
                    $event->getIO(),
                    $event->getComposer()
                )
            );

            $output = $event->getIO();
            if ($output->isVerbose()) {
                $output->write('Patched the PhpStorm config');
            }
        }
    }
1098586
public function onPostInstallCmd(Event $event)
    {
        $this->bridgeFactory->createBridge($event->getIO())
            ->install($event->getComposer(), $event->isDevMode());
    }
809159
public function newBranch(NewBranchEvent $event)
    {
        $branch = $event->getBranch();

        $related = $this->matcher->getRelatedIssues($branch);
        $branch->setIssuesRelated($related);

        $this->repository->persist($branch);
    }
85211
public function setEvent($event)
  {
    if ($event === '?' || $event === '') {
      $this->event = null;
    } else {
      $event = Util::foreignLettersToEnglishLetters($event);
      $event = Util::titleCaseIfCurrentlyAllCaps($event);
      $this->event = $event === '?' ? null : $event;
    }
  }