Source for file FeatureServerProxyFactory.php

Documentation is available at FeatureServerProxyFactory.php

  1. <?php
  2. /**
  3. * Construit le bon type de feature server proxy selon le type de requete
  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. * Construit le bon type de feature server proxy selon le type de requete
  16. @category   PHP
  17. @package    GeoPrisma
  18. @subpackage Proxy
  19. @author     Pascal Martin
  20. */  
  21. {
  22.     /**
  23.     * Return the good feature server proxy
  24.     * 
  25.     * @param org_geoprisma_service_FeatureServerService $pobjService Service
  26.     * 
  27.     * @return org_geoprisma_proxy_featureserver_FeatureServerGetCapabilityProxy 
  28.     */
  29.     public static function getFeatureServerProxy(org_geoprisma_service_FeatureServerService $pobjService)
  30.     {
  31.         // Set default to read
  32.         $objFeatureServerProxy new org_geoprisma_proxy_featureserver_FeatureServerReadProxy($pobjService);
  33.         
  34.         if (self::isGetCapability()) 
  35.         {    
  36.             $objFeatureServerProxy new org_geoprisma_proxy_featureserver_FeatureServerGetCapabilityProxy($pobjService);
  37.         }
  38.         elseif (self::isDelete())
  39.         {
  40.             $objFeatureServerProxy new org_geoprisma_proxy_featureserver_FeatureServerDeleteProxy($pobjService);
  41.         }
  42.         elseif (self::isUpdate())
  43.         {
  44.             $objFeatureServerProxy new org_geoprisma_proxy_featureserver_FeatureServerUpdateProxy($pobjService);
  45.         }
  46.         elseif (self::isCreate())        
  47.         
  48.             $objFeatureServerProxy new org_geoprisma_proxy_featureserver_FeatureServerCreateProxy($pobjService);
  49.         }    
  50.    
  51.         return $objFeatureServerProxy;
  52.     }
  53.     
  54.     /**
  55.     * Check if query is the type of getCapability | The layer is not specifield
  56.     * 
  57.     * @return bool 
  58.     */
  59.     private static function isGetCapability()
  60.     {
  61.         return $strLayer == '';
  62.     }
  63.     
  64.     /**
  65.     * Check if the query is delete | Request Method = DELETE
  66.     * 
  67.     * @return bool 
  68.     */
  69.     private static function isDelete()
  70.     {
  71.         $iId org_geoprisma_proxy_featureserver_FeatureServerProxy::getID();    
  72.         return $iId != null && isset($_SERVER['REQUEST_METHOD']&& $_SERVER['REQUEST_METHOD'== 'DELETE';    
  73.     }
  74.     
  75.     /**
  76.     * Check if the query is Create | Request Method = POST
  77.     * 
  78.     * @return bool 
  79.     */
  80.     private static function isCreate()
  81.     {    
  82.         $iId org_geoprisma_proxy_featureserver_FeatureServerProxy::getID();             
  83.         return $iId == null && isset($GLOBALS['HTTP_RAW_POST_DATA']!= null && $GLOBALS['HTTP_RAW_POST_DATA'!= '' && isset($_SERVER['REQUEST_METHOD']&& $_SERVER['REQUEST_METHOD'== 'POST';    
  84.     }
  85.     
  86.     /**
  87.     * Check if the query is delete
  88.     * 
  89.     * @return bool 
  90.     */
  91.     private static function isUpdate()
  92.     {
  93.         return $iId != null && isset($_SERVER['REQUEST_METHOD']&& $_SERVER['REQUEST_METHOD'== 'PUT';
  94.     }
  95. }
  96. ?>

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