Source for file Datastore.php
Documentation is available at Datastore.php
* Classe de base des datastore, Lier aux fichier de configuration
* @copyright 2009, Boreal - Information Strategies
* @license http://www.geoprisma.org/license BSD License
* @link http://www.geoprisma.org
* Classe de base des datastore, Lier aux fichier de configuration
private $m_strName =
null;
private $m_objArrayLayers =
null;
private $m_objArrayOption =
null;
* @var org_geoprisma_service_Service
private $m_objService =
null;
* Construit un nouvelle instance de org_geoprisma_datastore_Datastore
* @param string $pstrName Datastore name
* @param org_geoprisma_service_Service &$pobjService Service object
* @param string $pstrLayers String of layers
* @param array $pobjArrayOptions Datastore options
* @return org_geoprisma_datastore_Datastore
org_geoprisma_service_Service &$pobjService,
com_borealis_foundation_util_Assert::assertIsNotEmptyString($pstrName);
$this->m_strName =
$pstrName;
$this->m_objService =
$pobjService;
if ($pstrLayers !=
null &&
$pstrLayers !=
"")
$this->m_objArrayLayers =
$this->getLayersFromString($pstrLayers);
$this->m_objArrayOption =
new ArrayObject();
foreach ($pobjArrayOptions as $strOptionKey =>
$strOptionValue)
$this->m_objArrayOption->append(
* Extract layer names from a string
* @param string $pstrLayers Layers separated by ','
* @return ArrayObject of string
private function getLayersFromString($pstrLayers)
$objArrayLayers =
new ArrayObject();
$objArrayLayersTemp =
explode(",", $pstrLayers);
foreach ($objArrayLayersTemp as $strLayer)
$strLayer =
trim($strLayer);
$objArrayLayers->append($strLayer);
* Check if the passed layer are authorized
* @param string $pstrLayer Layer Name
* @return boolean true or false
com_borealis_foundation_util_Assert::assertIsNotEmptyString($pstrLayer);
if (array_search($pstrLayer, (array)
$this->m_objArrayLayers) ===
false)
* Return the DataStore name
* Return the Service object linked to this DataStore
* @return org_geoprisma_service_Service
return $this->m_objService;
* Return the layers array object
return $this->m_objArrayLayers;
* Get layer string (separated by ',')
* Get all datastore options
return $this->m_objArrayOption;
* Get a specific option using its name
* @param string $pstrName Option name
* @param boolean $pbSkipError Whether the method should skip throwing an
* error if no option is found.
* @return org_geoprisma_option_Option
public function getOption($pstrName, $pbSkipError=
false)
if ($objOption->getName() ==
$pstrName)
* Ajout le datastore courant (this) dans le xml
* @param DOMElement &$pobjDomElementDatastores Noeud xml ou le datastore doit être ajouter
* @param DOMDocument &$pobjDomDocument Document XMl ou le noeud xml datastore est ajouter, utiliser pour construire les noeuds
public function insertIntoXML(DOMElement &$pobjDomElementDatastores, DOMDocument &$pobjDomDocument)
$objDomElementDatastore =
$pobjDomDocument->createElement('datastore');
$pobjDomElementDatastores->appendChild($objDomElementDatastore);
$objDomElementName =
$pobjDomDocument->createElement('name', $this->getName());
$objDomElementService =
$pobjDomDocument->createElement('service', $this->getService()->getName());
$objDomElementDatastore->appendChild($objDomElementName);
$objDomElementDatastore->appendChild($objDomElementService);
$objDomElementLayers =
$pobjDomDocument->createElement(
$objDomElementParams->appendChild($objDomElementLayers);
$objDomElementDatastore->appendChild($objDomElementParams);
Documentation generated on Mon, 20 Feb 2012 13:46:11 -0500 by phpDocumentor 1.4.1