MediaSearch_Interface
[ class tree: MediaSearch_Interface ] [ index: MediaSearch_Interface ] [ all elements ]

Source for file Visitable.php

Documentation is available at Visitable.php

  1. <?php
  2. /**
  3.  * MediaSearch
  4.  *
  5.  * LICENSE
  6.  *
  7.  * "THE BEER-WARE LICENSE" (Revision 42):
  8.  * "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
  9.  * As long as you retain this notice you can do whatever you want with
  10.  * this stuff. If we meet some day, and you think this stuff is worth it,
  11.  * you can buy me a beer in return.
  12.  *
  13.  * $Author$
  14.  * $Revision$
  15.  *
  16.  * @category    MediaSearch
  17.  * @package     MediaSearch_Interface
  18.  * @copyright   Copyright (c) 2009 Sven Strittmatter
  19.  */
  20.  
  21. /**
  22.  * Objects implementing this interface are visitable by any objects
  23.  * implementing the MediaSearch_Interface_Visitor. This interface is part
  24.  * of the visitor pattern implementation in MediaSearch. See GoF for more
  25.  * Information.
  26.  *
  27.  * @category   MediaSearch
  28.  * @package    MediaSearch_Interface
  29.  * @copyright  Copyright (c) 2009 Sven Strittmatter
  30.  */
  31.     /**
  32.      * Acceptps any visitor implementing MediaSearch_Interface_Visitor.
  33.      * Use this method on your visitable objects to accept the visitor
  34.      * object and then visit it. For this purpose every visitor implementing
  35.      * MediaSearch_Interface_Visitor provides the method visit(). You pass the
  36.      * visitable object to the visitors visit method, so the visitor can collect
  37.      * some data. After that the visited object can give the visitor next to
  38.      * ist child objects to visit them, if they implement
  39.      * MediaSearch_Interface_Visitable, too.
  40.      *
  41.      * Example:
  42.      * <code>
  43.      * class MyVisitable implements MediaSearch_Interface_Visitable {
  44.      *      private $childs;
  45.      *      //...
  46.      *      public function acceptVisitor(MediaSearch_Interface_Visitor $visitor) {
  47.      *          $visitor->visit($this);
  48.      *
  49.      *          foreach ($this->childs as $child) {
  50.      *              $child->acceptVisitor($visitor);
  51.      *          }
  52.      *      }
  53.      * }
  54.      * </code>
  55.      *
  56.      * @access public
  57.      * @param MediaSearch_Interface_Visitor $visitor 
  58.      */
  59.     public function acceptVisitor(MediaSearch_Interface_Visitor $visitor);
  60. }

Documentation generated on Mon, 17 Aug 2009 14:54:24 +0200 by phpDocumentor 1.4.2