Source for file FeatureServerProxy.php

Documentation is available at FeatureServerProxy.php

  1. <?php
  2. /**
  3. * Class Proxy de type feature server
  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. * Class Proxy de type feature server
  16. @category   PHP
  17. @package    GeoPrisma
  18. @subpackage Proxy
  19. @author     Pascal Martin
  20. */   
  21. {
  22.     const PATH_INFO_REG = '/^\/([a-zA-Z0-9_]+)\/?(([0-9]*|all)\.?(GeoJSON|json|kml|atom|gml)?)$/i';
  23.     const PATH_INFO_LAYER_POS = 1;
  24.     const PATH_INFO_ID_POS = 3;
  25.     
  26.     /**
  27.     * Return Layer
  28.     * 
  29.     * @return string 
  30.     */
  31.     public function getLayer()
  32.     {
  33.         $strPathInfo self::getPathInfo();
  34.         $objArrayMatches array();
  35.         if (preg_match(self::PATH_INFO_REG$strPathInfo$objArrayMatches)) 
  36.         {
  37.             return $objArrayMatches[self::PATH_INFO_LAYER_POS];
  38.         }
  39.         return '';        
  40.     }
  41.     
  42.     /**
  43.     * Return data id
  44.     * 
  45.     * @return integer or null
  46.     */
  47.     public static function getID()
  48.     {
  49.         $strPathInfo self::getPathInfo();
  50.         $objArrayMatches array();
  51.         if (preg_match(self::PATH_INFO_REG$strPathInfo$objArrayMatches&& count($objArrayMatches>= self::PATH_INFO_ID_POS
  52.         {
  53.             $iID $objArrayMatches[self::PATH_INFO_ID_POS];
  54.             if (is_numeric($iID)) 
  55.             {                
  56.                 return (int)$iID;
  57.             }
  58.         }
  59.         return null;        
  60.     }
  61.     
  62.     /**
  63.     * Retourne la liste de layer accèder par la query
  64.     * 
  65.     * @return ArrayObject 
  66.     */
  67.     public function getLayers()
  68.     {
  69.         $objArrayLayers new ArrayObject();
  70.         $strLayer $this->getLayer();
  71.         if ($strLayer != ""
  72.         {
  73.             $objArrayLayers->append($strLayer);
  74.         }
  75.         return $objArrayLayers;    
  76.     }
  77. }
  78.   
  79. ?>

Documentation generated on Mon, 20 Feb 2012 13:46:12 -0500 by phpDocumentor 1.4.1