class CommitOrderCalculator (View source)

The CommitOrderCalculator is used by the UnitOfWork to sort out the correct order in which changes to entities need to be persisted.

Constants

NOT_VISITED

IN_PROGRESS

VISITED

Methods

void
clear()

Clears the current graph.

array
getCommitOrder()

Gets a valid commit order for all current nodes.

void
addDependency(ClassMetadata $fromClass, ClassMetadata $toClass)

No description

bool
hasClass(string $className)

No description

void
addClass(ClassMetadata $class)

No description

Details

void clear()

Clears the current graph.

Return Value

void

array getCommitOrder()

Gets a valid commit order for all current nodes.

Uses a depth-first search (DFS) to traverse the graph. The desired topological sorting is the reverse postorder of these searches.

Return Value

array The list of ordered classes.

void addDependency(ClassMetadata $fromClass, ClassMetadata $toClass)

Parameters

ClassMetadata $fromClass
ClassMetadata $toClass

Return Value

void

bool hasClass(string $className)

Parameters

string $className

Return Value

bool

void addClass(ClassMetadata $class)

Parameters

ClassMetadata $class

Return Value

void