Source for file HttpRequestService.php

Documentation is available at HttpRequestService.php

  1. <?php
  2. /**
  3. * Service of httpRequest type
  4. *
  5. * PHP versions 5
  6. @category  PHP
  7. @package   GeoPrisma
  8. @author    Frédérick Gagnon
  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. * Service of httpRequest type
  16. @category   PHP
  17. @package    GeoPrisma
  18. @subpackage Service
  19. @author     Frédérick Gagnon
  20. */   
  21. {
  22.     const HTTP_SERVICE = 'httprequest';
  23.     const TYPE = 'httprequest';
  24.     const TYPE_ID = 10;
  25.  
  26.     public $m_objArrayCreateHttpRequests = array();
  27.     public $m_objArrayReadHttpRequests = array();
  28.     public $m_objArrayUpdateHttpRequests = array();
  29.     public $m_objArrayDeleteHttpRequests = array();
  30.     /**
  31.     * Creates a new instance of org_geoprisma_service_HttpRequestService
  32.     * 
  33.     * @param array $pobjArray Config array
  34.     * 
  35.     * @return org_geoprisma_service_HttpRequestService 
  36.     */
  37.     public function __construct($pobjArray
  38.     {
  39.         if (isset($pobjArray['id']))
  40.         {
  41.             $strName = (string)$pobjArray['id'];
  42.         }
  43.         else
  44.         {
  45.             $strName = (string)$pobjArray['name'];
  46.         }
  47.  
  48.         $strSource = (string)$pobjArray['source'];
  49.  
  50.         if (isset($pobjArray['options']['createHttpRequests']))
  51.         {
  52.             $this->m_objArrayCreateHttpRequests = explode(','(string)$pobjArray['options']['createHttpRequests']);
  53.         }
  54.  
  55.         if (isset($pobjArray['options']['readHttpRequests']))
  56.         {
  57.             $this->m_objArrayReadHttpRequests = explode(','(string)$pobjArray['options']['readHttpRequests']);
  58.         }
  59.  
  60.         if (isset($pobjArray['options']['updateHttpRequests']))
  61.         {
  62.             $this->m_objArrayUpdateHttpRequests = explode(','(string)$pobjArray['options']['updateHttpRequests']);
  63.         }
  64.  
  65.         if (isset($pobjArray['options']['deleteHttpRequests']))
  66.         {
  67.             $this->m_objArrayDeleteHttpRequests = explode(','(string)$pobjArray['options']['deleteHttpRequests']);
  68.         }
  69.  
  70.         parent::__construct($strName$strSourceself::TYPE$pobjArray);
  71.     }
  72.  
  73.     /**
  74.     * Return the OpenLayers.Layer default options using this type of service.
  75.     *
  76.     * @param org_geoprisma_config_Config &$pobjConfig Config object
  77.     *
  78.     * @return array 
  79.     */
  80.     public function getDefaultLayerOptions(&$pobjConfig)
  81.     {
  82.         return array();
  83.     }
  84.    
  85.     /**
  86.     * Add current service in XML document.
  87.     *
  88.     * @param DOMElement  &$pobjDomElementServices XML node where this service
  89.     *                                              must be added
  90.     * @param DOMDocument &$pobjDomDocument        DOMDocument XMl used to create
  91.     *                                              new nodes.
  92.     * 
  93.     * @return void 
  94.     */
  95.     public function insertIntoXML(DOMElement &$pobjDomElementServicesDOMDocument &$pobjDomDocument)
  96.     {
  97.         $objDomElementService $pobjDomDocument->createElement('service')
  98.         $pobjDomElementServices->appendChild($objDomElementService);        
  99.         $objDomElementType $pobjDomDocument->createElement('type'self::HTTP_SERVICE);
  100.         $objDomElementName $pobjDomDocument->createElement('name'$this->getName());
  101.         $objDomElementService->appendChild($objDomElementType);
  102.         $objDomElementService->appendChild($objDomElementName)
  103.  
  104.         // options node
  105.         $objDomElementService->appendChild(
  106.             $this->getDomElements(
  107.                 'options'$this->getOptions()$pobjDomDocument
  108.             )
  109.         );
  110.     }
  111. }
  112.   
  113. ?>

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