Doctrine


Doctrine\ORM\Internal\CommitOrderCalculator
/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 31

Class CommitOrderCalculator

CommitOrderCalculator

public class CommitOrderCalculator

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

Since:
2.0
Author:
Roman Borschel

Field Summary
final int

IN_PROGRESS

final int

NOT_VISITED

final int

VISITED

Method Summary
void

addClass(mixed class)

void

addDependency(mixed fromClass, mixed toClass)

void

clear()

Clears the current graph.

array

getCommitOrder()

Gets a valid commit order for all current nodes.

void

hasClass(mixed className)

Field Detail

/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 34

IN_PROGRESS

public final int IN_PROGRESS = 2

/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 33

NOT_VISITED

public final int NOT_VISITED = 1

/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 35

VISITED

public final int VISITED = 3

Method Detail

/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 116

addClass

public void addClass(mixed class)

/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 106

addDependency

public void addDependency(mixed fromClass, mixed toClass)

/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 47

clear

public void clear()

Clears the current graph.


/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 61

getCommitOrder

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.

Returns:
The list of ordered classes.

/Doctrine/ORM/Internal/CommitOrderCalculator.php at line 111

hasClass

public void hasClass(mixed className)

Doctrine