accept( $this ); } /** * Visits the node, adds it to the list of nodes. * * Returns true if the node was added. False if it was already in the list * of nodes. * * @param ezcWorkflowVisitable $visitable * @return boolean */ public function visit( ezcWorkflowVisitable $visitable ) { if ( $visitable instanceof ezcWorkflowNode ) { $id = $visitable->getId(); if ( $id === false ) { $id = $this->nextId++; $visitable->setId( $id ); } if ( isset( $this->nodes[$id] ) ) { return false; } $this->nodes[$id] = $visitable; } return true; } /** * Returns the collected nodes. * * @return array */ public function getNodes() { return $this->nodes; } } ?>