Source for file Visitor.php
Documentation is available at Visitor.php
* "THE BEER-WARE LICENSE" (Revision 42):
* "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
* As long as you retain this notice you can do whatever you want with
* this stuff. If we meet some day, and you think this stuff is worth it,
* you can buy me a beer in return.
* @package MediaSearch_Interface
* @copyright Copyright (c) 2009 Sven Strittmatter
* A visitor is an object which can visit other objects which implements
* MediaSearch_Interface_Visitable. See visitor pattern from GoF for more
* @package MediaSearch_Interface
* @copyright Copyright (c) 2009 Sven Strittmatter
* If a visitable object accepts the visior it should call
* this method with $this, or with all other visitable properties
* which are in interest for the visitor.
* In this visit method you can ask the visiting subject(s) for the
* information your visitor is interested in.
* class MyTreeVisitor implements MediaSearch_Interface_Visitor{
* private $countNodes = 0;
* private $countLeafes = 0;
* public function visit(MediaSearch_Interface_Visitable $visitingSubject) {
* if ($visitingSubject instanceof MyTreeObject) {
* if ($visitingSubject->isNode()) {
* } else if ($visitingSubject->isLeaf()) {
* @param MediaSearch_Interface_Visitable $visitingSubject
public function visit(MediaSearch_Interface_Visitable $visitingSubject);
|