Exemplo n.º 1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 2
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->searchFilters['eo:test'] = array('key' => 'test', 'osKey' => 'test', 'operation' => '=', 'keyword' => array('value' => 'test={:test:}', 'type' => 'other'));
 }
Exemplo n.º 3
0
 /**
  * Store feature within {collection}.features table following the class model
  * 
  * @param array $data : array (MUST BE GeoJSON in abstract Model)
  * @param RestoCollection $collection
  * 
  */
 public function storeFeature($data, $collection)
 {
     return parent::storeFeature($this->parse(join('', $data)), $collection);
 }
Exemplo n.º 4
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->searchFilters = array_merge($this->searchFilters, $this->extendedSearchFilters);
     /**
      * Read config.php file
      */
     $configFile = realpath(dirname(__FILE__)) . '/../../config.php';
     if (!file_exists($configFile)) {
         RestoLogUtil::httpError(4000, 'Missing mandatory configuration file');
     }
     $this->config = (include $configFile);
 }
Exemplo n.º 5
0
 /**
  * Constructor
  * 
  * @param RestoContext $context : Resto context
  * @param RestoContext $user : Resto user
  */
 public function __construct()
 {
     parent::__construct();
     $this->searchFilters['resto:dataTakeId'] = array('key' => 'dataTakeId', 'osKey' => 'dataTakeId', 'operation' => '=');
 }
Exemplo n.º 6
0
 /**
  * Process complex interval
  * 
  * @param RestoModel $model
  * @param string $filterName
  * @param array $requestParams
  * @param array $values
  * @return string
  */
 private function processComplexInterval($model, $filterName, $values)
 {
     /*
      * First and last characters give operators
      */
     $op1 = substr(trim($values[0]), 0, 1);
     $op2 = substr(trim($values[1]), -1);
     /*
      * A = {n1,n2} then returns  = n1 or = n2
      */
     if ($op1 === '{' && $op2 === '}') {
         return '(' . $model->getDbKey($model->searchFilters[$filterName]['key']) . ' = ' . pg_escape_string(substr($values[0], 1)) . ' OR ' . $model->getDbKey($model->searchFilters[$filterName]['key']) . ' = ' . pg_escape_string(substr($values[1], 0, strlen($values[1]) - 1)) . ')';
     }
     /*
      * Other cases i.e. 
      * A = [n1,n2] then returns <= n1 and <= n2
      * A = [n1,n2[ then returns <= n1 and B < n2
      * A = ]n1,n2[ then returns < n1 and B < n2
      * 
      */
     if (($op1 === '[' || $op1 === ']') && ($op2 === '[' || $op2 === ']')) {
         return $model->getDbKey($model->searchFilters[$filterName]['key']) . ($op1 === '[' ? ' >= ' : ' > ') . pg_escape_string(substr($values[0], 1)) . ' AND ' . $model->getDbKey($model->searchFilters[$filterName]['key']) . ($op2 === ']' ? ' <= ' : ' < ') . pg_escape_string(substr($values[1], 0, strlen($values[1]) - 1));
     }
 }