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

Source for file AbstractChain.php

Documentation is available at AbstractChain.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
  18.  * @copyright   Copyright (c) 2009 Sven Strittmatter
  19.  */
  20.  
  21. /**
  22.  * This is a base implementation for chaining single filter objects together.
  23.  * 
  24.  * @todo von ArrayAccess erben
  25.  *
  26.  * @abstract
  27.  * @category   MediaSearch
  28.  * @package    MediaSearch_Filter
  29.  * @copyright  Copyright (c) 2009 Sven Strittmatter
  30.  */
  31.     const TRACE_LELVEL 42;
  32.  
  33.     /**
  34.      * Array of filter objects.
  35.      *
  36.      * @access protected
  37.      * @var array 
  38.      */
  39.     private $filters;
  40.  
  41.     /**
  42.      * Sets filters to empty array.
  43.      *
  44.      * @access public
  45.      */
  46.     public function __construct({
  47.         $this->removeFilters();
  48.     }
  49.  
  50.     /**
  51.      * Adds a filter object to the cahin.
  52.      *
  53.      * @acess public
  54.      * @param MediaSearch_Filter_Interface $f 
  55.      */
  56.     public function addFilter(MediaSearch_Filter_Interface $f{
  57.         $this->filters[$f;
  58.     }
  59.  
  60.     /**
  61.      * Returns whether the chain has filter objects or not.
  62.      *
  63.      * @access public
  64.      * @return bool 
  65.      */
  66.     public function hasFilter({
  67.         return !empty($this->filters);
  68.     }
  69.  
  70.     /**
  71.      * Returns the filters.
  72.      *
  73.      * @access public
  74.      * @return array 
  75.      */
  76.     public function getFilters({
  77.         return $this->filters;
  78.     }
  79.  
  80.     /**
  81.      * Removes all filters.
  82.      *
  83.      * @acces public
  84.      */
  85.      public function removeFilters({
  86.         $this->filters array();
  87.      }
  88. }

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