Produces the following sequence when a model changes from status A to status B:

- beforeChangeStatus(A,B)
- afterChangeStatus(A,B)

@see \raoul2000\workflow\events\IEventSequence::createChangeStatusSequence()
544076
public function createChangeStatusSequence($transition, $sender)
	{
		$config = [
			'start'      => $transition->getStartStatus(),
			'end'  		 => $transition->getEndStatus(),
			'transition' => $transition,
			'sender'  	 => $sender
		];
		return [
			'before' => [
				new WorkflowEvent(
					WorkflowEvent::beforeChangeStatus($transition->getStartStatus()->getId(), $transition->getEndStatus()->getId()),
					$config
				)
			],
			'after' => [
				new WorkflowEvent(
					WorkflowEvent::afterChangeStatus($transition->getStartStatus()->getId(), $transition->getEndStatus()->getId()),
					$config
				)
			]
		];
	}
218933
public function setOrderSequence($orderSequence) {
        if (false === in_array($orderSequence, DataTablesEnumerator::enumOrderSequences())) {
            $orderSequence = null;
        }
        $this->orderSequence = $orderSequence;
        return $this;
    }
1207921
public function createEvent(Model $model,$event ,$body ,$totalUse ,$isAdd = true)
    {
        $eventType = $this->getEventType($event ,$isAdd);
        $nowHave = $this->getCanUsePoints()->sum('number');
        $totalAfter = $isAdd ? $totalUse + $nowHave : $nowHave - $totalUse;

        $this->event = $model->pointEvent()->create([
            'point_event_type_id' => $eventType->id,
            'body' => $body,
            'user_id' => $this->id,
            'total' => $totalUse,
            'total_before' => $nowHave,
            'total_after' => $totalAfter
        ]);

        return $this;
    }
878945
public function toASN1(): Sequence
    {
        $elements = array_values(
            array_map(
                function ($ext) {
                    return $ext->toASN1();
                }, $this->_extensions));
        return new Sequence(...$elements);
    }
1319586
public function createLeaveWorkflowSequence($finalStatus, $sender)
	{
		$config = [
			'start'      => $finalStatus,
			'sender'  	 => $sender
		];
		
		return [
			'before' => [
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveStatus($finalStatus->getId()),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			],
			'after' => [
				new WorkflowEvent(
					WorkflowEvent::afterLeaveStatus($finalStatus->getId()),
					$config
				),
				new WorkflowEvent(
					WorkflowEvent::afterLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			]
		];
	}
132017
public function create()
    {
        // Event
        $this->triggerEvent('onBefore' . ucfirst(__FUNCTION__), []);

        $this->triggerEvent('onBeforeStore');

        // Do Action
        $this->getDataMapper()->createOne($this);

        // Event
        $this->triggerEvent('onAfterStore');

        $this->triggerEvent('onAfter' . ucfirst(__FUNCTION__));

        return $this;
    }
1094288
function createSequence() {
    $cnt = count( $this->sequence );
    if( 0 >= $cnt )
      return;
    $attributes = $this->_createParams( $this->sequence['params'] );
    return $this->_createElement( 'SEQUENCE', $attributes, $this->sequence['value'] );
  }
1062589
private function getCommitOrder(array $entityChangeSet = null)
    {
        if ($entityChangeSet === null) {
            $entityChangeSet = array_merge($this->entityInsertions, $this->entityUpdates, $this->entityDeletions);
        }

        $calc = $this->getCommitOrderCalculator();

        // See if there are any new classes in the changeset, that are not in the
        // commit order graph yet (don't have a node).
        // We have to inspect changeSet to be able to correctly build dependencies.
        // It is not possible to use IdentityMap here because post inserted ids
        // are not yet available.
        $newNodes = array();

        foreach ($entityChangeSet as $entity) {
            $class = $this->em->getClassMetadata(get_class($entity));

            if ($calc->hasClass($class->name)) {
                continue;
            }

            $calc->addClass($class);

            $newNodes[] = $class;
        }

        // Calculate dependencies for new nodes
        while ($class = array_pop($newNodes)) {
            foreach ($class->associationMappings as $assoc) {
                if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) {
                    continue;
                }

                $targetClass = $this->em->getClassMetadata($assoc['targetEntity']);

                if ( ! $calc->hasClass($targetClass->name)) {
                    $calc->addClass($targetClass);

                    $newNodes[] = $targetClass;
                }

                $calc->addDependency($targetClass, $class);

                // If the target class has mapped subclasses, these share the same dependency.
                if ( ! $targetClass->subClasses) {
                    continue;
                }

                foreach ($targetClass->subClasses as $subClassName) {
                    $targetSubClass = $this->em->getClassMetadata($subClassName);

                    if ( ! $calc->hasClass($subClassName)) {
                        $calc->addClass($targetSubClass);

                        $newNodes[] = $targetSubClass;
                    }

                    $calc->addDependency($targetSubClass, $class);
                }
            }
        }

        return $calc->getCommitOrder();
    }
1071958
public function _mergeWithPrevious($previous)
    {
        if (!$previous)
        {
            return $this;
        }
        if ($previous instanceof DeleteOperation)
        {
            return new SetOperation($this->value);
        }
        if ($previous instanceof SetOperation)
        {
            return new SetOperation($previous->getValue() + $this->value);
        }
        if ($previous instanceof IncrementOperation)
        {
            return new IncrementOperation($previous->getValue() + $this->value);
        }
        throw new AVException('Operation is invalid after previous operation.');
    }
982453
public function changeState()
    {
        $this->getStates();

        $actualState = $this->getState();
        $newState = self::$statesHandler[$actualState]['state'];
        $action = self::$statesHandler[$actualState]['action'];

        $this->setState($newState);
        $this->doAction($action);

        return $newState;
    }
155746
public function toASN1(): Sequence
    {
        if (!count($this->_names)) {
            throw new \LogicException(
                "GeneralNames must have at least one GeneralName.");
        }
        $elements = array_map(
            function (GeneralName $name) {
                return $name->toASN1();
            }, $this->_names);
        return new Sequence(...$elements);
    }
524927
public function getScenarioSequence($status)
	{
		list( , $scenario) = $this->createTransitionItems($status, true, false);
		return $scenario;
	}
1167697
public function entriesStatusChangeAction($status, Request $request)
    {
        $entries = [];
        $serializedEntries = [];
        $entriesParams = $this->decodeIdsString($request, 'Claroline\ClacoFormBundle\Entity\Entry');

        foreach ($entriesParams as $entryParam) {
            if (!$entryParam->isLocked()) {
                $entries[] = $entryParam;
            }
        }
        foreach ($entries as $entry) {
            $this->clacoFormManager->checkEntryModeration($entry);
        }
        $updatedEntries = $this->clacoFormManager->changeEntriesStatus($entries, intval($status));

        foreach ($updatedEntries as $entry) {
            $serializedEntries[] = $this->entrySerializer->serialize($entry);
        }

        return new JsonResponse($serializedEntries, 200);
    }
514531
public function toASN1(): Sequence
    {
        $elements = [];
        if (isset($this->_baseCertificateID)) {
            $elements[] = new ImplicitlyTaggedType(0,
                $this->_baseCertificateID->toASN1());
        }
        if (isset($this->_entityName)) {
            $elements[] = new ImplicitlyTaggedType(1,
                $this->_entityName->toASN1());
        }
        if (isset($this->_objectDigestInfo)) {
            $elements[] = new ImplicitlyTaggedType(2,
                $this->_objectDigestInfo->toASN1());
        }
        return new Sequence(...$elements);
    }
18733
public function _mergeWithPrevious($previous)
    {
        if (!$previous)
        {
            return $this;
        }
        if ($previous instanceof DeleteOperation)
        {
            return new SetOperation($this->objects);
        }
        if ($previous instanceof SetOperation)
        {
            $oldValue = $previous->getValue();
            $result = $this->_apply($oldValue, null, null);

            return new SetOperation($result);
        }
        if ($previous instanceof AddUniqueOperation)
        {
            $oldList = $previous->getValue();
            $result = $this->_apply($oldList, null, null);

            return new AddUniqueOperation($result);
        }
        throw new AVException('Operation is invalid after previous operation.');
    }
652942
public function createLeaveWorkflowSequence($finalStatus, $sender)
	{
		$config = [
			'start'      => $finalStatus,
			'sender'  	 => $sender
		];
		return [
			'before' => [
				new WorkflowEvent(
					WorkflowEvent::beforeLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			],
			'after' => [
				new WorkflowEvent(
					WorkflowEvent::afterLeaveWorkflow($finalStatus->getWorkflowId()),
					$config
				)
			]
		];
	}
110457
public function order($change)
    {
        //force to integer
        settype($change, 'int');

        if($change !== 0)
        {
            $old = (int) $this->ordering;
            $new = $this->ordering + $change;
            $new = $new <= 0 ? 1 : $new;

            $table = $this->getTable();
            $query = $this->getObject('lib:database.query.update')
                ->table($table->getBase());

            //Build the where query
            $this->_buildQueryWhere($query);

            if($change < 0)
            {
                $query->values('ordering = ordering + 1')
                    ->where('ordering >= :new')
                    ->where('ordering <  :old')
                    ->bind(array('new' => $new, 'old' => $old));
            }
            else
            {
                $query->values('ordering = ordering - 1')
                ->where('ordering <=  :new')
                ->where('ordering > :old')
                ->bind(array('new' => $new, 'old' => $old));
            }

            $table->getDriver()->update($query);

            $this->ordering = $new;
            $this->save();
            $this->reorder();
        }

        return $this->getMixer();
    }