CommitOrderCalculator
public class CommitOrderCalculator
Field Summary | |
---|---|
final int | |
final int | |
final int |
Method Summary | |
---|---|
void | addClass(mixed class) |
void | addDependency(mixed fromClass, mixed toClass) |
void | clear() Clears the current graph. |
array | Gets a valid commit order for all current nodes. |
void | hasClass(mixed className) |
public final int IN_PROGRESS = 2
public final int NOT_VISITED = 1
public final int VISITED = 3
public void addClass(mixed class)
public void addDependency(mixed fromClass, mixed toClass)
public void clear()
Clears the current graph.
public 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.
public void hasClass(mixed className)
The CommitOrderCalculator is used by the UnitOfWork to sort out the correct order in which changes to entities need to be persisted.