IRuleMatcher.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
  5. *
  6. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCP\WorkflowEngine;
  25. use RuntimeException;
  26. /**
  27. * Class IRuleMatcher
  28. *
  29. *
  30. * @since 18.0.0
  31. */
  32. interface IRuleMatcher extends IFileCheck {
  33. /**
  34. * This method is left for backwards compatibility and easier porting of
  35. * apps. Please use 'getFlows' instead (and setOperation if you implement
  36. * an IComplexOperation).
  37. *
  38. * @since 18.0.0
  39. * @deprecated 18.0.0
  40. */
  41. public function getMatchingOperations(string $class, bool $returnFirstMatchingOperationOnly = true): array;
  42. /**
  43. * @throws RuntimeException
  44. * @since 18.0.0
  45. */
  46. public function getFlows(bool $returnFirstMatchingOperationOnly = true): array;
  47. /**
  48. * this method can only be called once and is typically called by the
  49. * Flow engine, unless for IComplexOperations.
  50. *
  51. * @throws RuntimeException
  52. * @since 18.0.0
  53. */
  54. public function setOperation(IOperation $operation): void;
  55. /**
  56. * this method can only be called once and is typically called by the
  57. * Flow engine, unless for IComplexOperations.
  58. *
  59. * @throws RuntimeException
  60. * @since 18.0.0
  61. */
  62. public function setEntity(IEntity $entity): void;
  63. /**
  64. * returns the entity which might provide more information, depending on
  65. * the interfaces it implements
  66. *
  67. * @return IEntity
  68. * @since 18.0.0
  69. */
  70. public function getEntity(): IEntity;
  71. /**
  72. * this method can be called once to set the event name that is currently
  73. * being processed. The workflow engine takes care of this usually, only an
  74. * IComplexOperation might want to make use of it.
  75. *
  76. * @throws RuntimeException
  77. * @since 20.0.0
  78. */
  79. public function setEventName(string $eventName): void;
  80. }