Source for file AccessFilter.php

Documentation is available at AccessFilter.php

  1. <?php
  2. /**
  3. * Classe de base des accessfilter, Lier aux fichier de configuration
  4. *
  5. * PHP versions 5
  6. @category  PHP
  7. @package   GeoPrisma
  8. @author    Pascal Martin
  9. @copyright 2009, Boreal - Information Strategies
  10. @license   http://www.geoprisma.org/license BSD License
  11. @link      http://www.geoprisma.org
  12. */
  13.  
  14. /**
  15. * Classe de base des accessfilter, Lier aux fichier de configuration
  16. @category   PHP
  17. @package    GeoPrisma
  18. @subpackage AccessFilter
  19. @author     Pascal Martin
  20. */ 
  21. {
  22.     private $m_strName null;
  23.     private $m_objConditions null;
  24.  
  25.     /**
  26.     * Construit un nouvelle instance de org_geoprisma_accessfilter_AccessFilter
  27.     * 
  28.     * @param string                        $pstrName         AccessFilter name
  29.     * @param org_geoprisma_service_Service &$pobjService     Service object
  30.     * @param string                        $pstrLayers       String of layers
  31.     * @param array                         $pobjArrayOptions AccessFilter options
  32.     * 
  33.     * @return org_geoprisma_accessfilter_AccessFilter 
  34.     */
  35.     public function __construct(
  36.         $pstrName,
  37.         $pobjArrayConditions
  38.     {
  39.         com_borealis_foundation_util_Assert::assertIsNotEmptyString($pstrName);
  40.  
  41.         // name & type
  42.         // Available types: BBox, SessionParam
  43.         $this->m_strName $pstrName;
  44.  
  45.         // condition
  46.         $this->m_objArrayConditions new ArrayObject();
  47.         if (is_array($pobjArrayConditions)) 
  48.         {
  49.             foreach ($pobjArrayConditions as $strCondition
  50.             {
  51.                 $this->m_objArrayConditions->append($strCondition);     
  52.             }
  53.         }
  54.     }
  55.  
  56.     /**
  57.     * Return the AccessFilter name
  58.     *
  59.     * @return string 
  60.     */
  61.     public function getName()
  62.     {
  63.         return $this->m_strName;
  64.     }
  65.  
  66.     /**
  67.     * Return the AccessFilter condition
  68.     *
  69.     * @return string 
  70.     */
  71.     public function getCondition($pnCondition)
  72.     {
  73.         return $this->m_objArrayConditions[$pnCondition];
  74.     }
  75.  
  76.     /**
  77.     * Return the AccessFilter conditions
  78.     *
  79.     * @return string 
  80.     */
  81.     public function getConditions()
  82.     {
  83.         return $this->m_objArrayConditions;
  84.     }
  85.  
  86.     /**
  87.     * Return the AccessFilter input.
  88.     * input can be a string or something from the session with:
  89.     *   SESSION:session_variable  (Later we could have BD:string)
  90.     *
  91.     * @return string 
  92.     */
  93.     public function readInput($pstrInput)
  94.     {
  95.         $objArrayInputParts explode(':'$pstrInput);
  96.  
  97.         switch($objArrayInputParts[0])
  98.         {
  99.           case 'SESSION':
  100.             if(isset($objArrayInputParts[1]&& 
  101.                isset($_SESSION[$objArrayInputParts[1]]))
  102.             {
  103.                 return $_SESSION[$objArrayInputParts[1]];
  104.             }
  105.           default:
  106.             return $objArrayInputParts[0];
  107.         }
  108.  
  109.         return '';
  110.     }
  111.     
  112.     /**
  113.     *  Ajout le accessfilter courant (this) dans le xml
  114.     * 
  115.     * @param DOMElement  &$pobjDomElementAccessFilters Noeud xml ou le accessfilter doit Ãªtre ajouter
  116.     * @param DOMDocument &$pobjDomDocument          Document XMl ou le noeud xml accessfilter est ajouter, utiliser pour construire les noeuds
  117.     * 
  118.     * @return void 
  119.     */
  120.     public function insertIntoXML(DOMElement &$pobjDomElementAccessFiltersDOMDocument &$pobjDomDocument)
  121.     {
  122.         $objDomElementAccessFilter $pobjDomDocument->createElement('accessfilter')
  123.         $pobjDomElementAccessFilters->appendChild($objDomElementAccessFilter);        
  124.         $objDomElementName $pobjDomDocument->createElement('name'$this->getName())
  125.         $objDomElementAccessFilter->appendChild($objDomElementName);
  126.     }
  127.     
  128. }
  129.  
  130. ?>

Documentation generated on Thu, 19 Jan 2012 00:08:23 +0400 by phpDocumentor 1.4.1