IRuleMatcher.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\WorkflowEngine;
  8. use RuntimeException;
  9. /**
  10. * Class IRuleMatcher
  11. *
  12. *
  13. * @since 18.0.0
  14. */
  15. interface IRuleMatcher extends IFileCheck {
  16. /**
  17. * This method is left for backwards compatibility and easier porting of
  18. * apps. Please use 'getFlows' instead (and setOperation if you implement
  19. * an IComplexOperation).
  20. *
  21. * @since 18.0.0
  22. * @deprecated 18.0.0
  23. */
  24. public function getMatchingOperations(string $class, bool $returnFirstMatchingOperationOnly = true): array;
  25. /**
  26. * @throws RuntimeException
  27. * @since 18.0.0
  28. */
  29. public function getFlows(bool $returnFirstMatchingOperationOnly = true): array;
  30. /**
  31. * this method can only be called once and is typically called by the
  32. * Flow engine, unless for IComplexOperations.
  33. *
  34. * @throws RuntimeException
  35. * @since 18.0.0
  36. */
  37. public function setOperation(IOperation $operation): void;
  38. /**
  39. * this method can only be called once and is typically called by the
  40. * Flow engine, unless for IComplexOperations.
  41. *
  42. * @throws RuntimeException
  43. * @since 18.0.0
  44. */
  45. public function setEntity(IEntity $entity): void;
  46. /**
  47. * returns the entity which might provide more information, depending on
  48. * the interfaces it implements
  49. *
  50. * @return IEntity
  51. * @since 18.0.0
  52. */
  53. public function getEntity(): IEntity;
  54. /**
  55. * this method can be called once to set the event name that is currently
  56. * being processed. The workflow engine takes care of this usually, only an
  57. * IComplexOperation might want to make use of it.
  58. *
  59. * @throws RuntimeException
  60. * @since 20.0.0
  61. */
  62. public function setEventName(string $eventName): void;
  63. }