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

Source for file Chain.php

Documentation is available at Chain.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_Filter_KeyWords
  18.  * @copyright   Copyright (c) 2009 Sven Strittmatter
  19.  */
  20.  
  21. /**
  22.  * @see MediaSearch_Filter_AbstractChain
  23.  */
  24. require_once('MediaSearch/Filter/AbstractChain.php');
  25. /**
  26.  * @see MediaSearch_Filter_KeyWords_Interface
  27.  */
  28. require_once('MediaSearch/Filter/KeyWords/Interface.php');
  29.  
  30. /**
  31.   * A concrete filter chain implementation to chain key word filters together.
  32.   *
  33.   * @category   MediaSearch
  34.   * @package    MediaSearch_Filter_KeyWords
  35.   * @copyright  Copyright (c) 2009 Sven Strittmatter
  36.   */
  37.                                         implements MediaSearch_Filter_KeyWords_Interface {
  38.     const TRACE_LEVEL = 32;
  39.  
  40.     /**
  41.      * Acceppts an array of key word string and processes each added fileter
  42.      * on this array.
  43.      *
  44.      * @access public
  45.      * @param array $input 
  46.      */
  47.     public function process(array $input{
  48.         MediaSearch_Log::trace('Processing filters...'self::TRACE_LEVEL);
  49.  
  50.         if (!$this->hasFilter()) {
  51.             MediaSearch_Log::warn('Doesnt have filters in chain!');
  52.             return;
  53.         }
  54.  
  55.         foreach ($this->getFilters(as $filter{
  56.             $input $filter->process($input);
  57.         }
  58.  
  59.         MediaSearch_log::trace('Processing finished.'self::TRACE_LEVEL);
  60.  
  61.         return $input;
  62.     }
  63. }

Documentation generated on Mon, 17 Aug 2009 14:51:47 +0200 by phpDocumentor 1.4.2