SelectFeature.php 772 B

1234567891011121314151617181920212223
  1. <?php
  2. Lib::loadClass('FeatureAttrSelected');
  3. class Api_Process_P5_SelectFeature { // TODO: extends Api_ProcessBase
  4. static function run($args, $responseForm) {
  5. $typeName = (!empty($args['typeName'][0])) ? $args['typeName'][0] : '';
  6. if (!$typeName) throw new Api_OwsException("Missing value for 'typeName'", 501, null, 'MissingParameterValue', 'request');
  7. $listPrimaryKeys = (!empty($args['primaryKey'])) ? $args['primaryKey'] : [];
  8. if (empty($listPrimaryKeys)) throw new Api_OwsException("Missing value for 'primaryKey'", 501, null, 'MissingParameterValue', 'request');
  9. FeatureAttrSelected::select($typeName, $listPrimaryKeys);
  10. header('Content-Type: application/json');
  11. echo json_encode([
  12. 'type' => "success",
  13. 'msg' => "done",
  14. ]);
  15. exit;
  16. }
  17. }