NamespaceBuilderInterface.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Class RegisteredNamespaceInterface
  4. *
  5. * @category Elasticsearch
  6. * @package Elasticsearch\Namespaces
  7. * @author Zachary Tong <zach@elastic.co>
  8. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  9. * @link http://elastic.co
  10. */
  11. namespace Elasticsearch\Namespaces;
  12. use Elasticsearch\Serializers\SerializerInterface;
  13. use Elasticsearch\Transport;
  14. interface NamespaceBuilderInterface
  15. {
  16. /**
  17. * Returns the name of the namespace. This is what users will call, e.g. the name
  18. * "foo" will be invoked by the user as `$client->foo()`
  19. * @return string
  20. */
  21. public function getName();
  22. /**
  23. * Returns the actual namespace object which contains your custom methods. The transport
  24. * and serializer objects are provided so that your namespace may do whatever custom
  25. * logic is required.
  26. *
  27. * @param Transport $transport
  28. * @param SerializerInterface $serializer
  29. * @return Object
  30. */
  31. public function getObject(Transport $transport, SerializerInterface $serializer);
  32. }