visited = new SplObjectStorage; } /** * Returns the number of visited nodes. * * @return integer */ public function count() { return count( $this->visited ); } /** * Visit the $visitable. * * Each node in the graph is visited once. * * @param ezcWorkflowVisitable $visitable * @return bool */ public function visit( ezcWorkflowVisitable $visitable ) { if ( $visitable instanceof ezcWorkflowNode ) { if ( $this->visited->contains( $visitable ) ) { return false; } $this->visited->attach( $visitable ); } $this->doVisit( $visitable ); return true; } /** * Perform the visit. * * @param ezcWorkflowVisitable $visitable */ protected function doVisit( ezcWorkflowVisitable $visitable ) { } } ?>