Get.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace Elasticsearch\Endpoints\Indices\Mapping;
  3. use Elasticsearch\Endpoints\AbstractEndpoint;
  4. /**
  5. * Class Get
  6. *
  7. * @category Elasticsearch
  8. * @package Elasticsearch\Endpoints\Indices\Mapping
  9. * @author Zachary Tong <zach@elastic.co>
  10. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  11. * @link http://elastic.co
  12. */
  13. class Get extends AbstractEndpoint
  14. {
  15. /**
  16. * @return string
  17. */
  18. public function getURI()
  19. {
  20. $index = $this->index;
  21. $type = $this->type;
  22. $uri = "/_mapping";
  23. if (isset($index) === true && isset($type) === true) {
  24. $uri = "/$index/_mapping/$type";
  25. } elseif (isset($type) === true) {
  26. $uri = "/_mapping/$type";
  27. } elseif (isset($index) === true) {
  28. $uri = "/$index/_mapping";
  29. }
  30. return $uri;
  31. }
  32. /**
  33. * @return string[]
  34. */
  35. public function getParamWhitelist()
  36. {
  37. return array(
  38. 'ignore_unavailable',
  39. 'allow_no_indices',
  40. 'expand_wildcards',
  41. 'wildcard_expansion',
  42. 'local',
  43. );
  44. }
  45. /**
  46. * @return string
  47. */
  48. public function getMethod()
  49. {
  50. return 'GET';
  51. }
  52. }