IRuleMatcher.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. * @package OCP\WorkflowEngine
  30. *
  31. * @since 18.0.0
  32. */
  33. interface IRuleMatcher extends IFileCheck {
  34. /**
  35. * This method is left for backwards compatibility and easier porting of
  36. * apps. Please use 'getFlows' instead (and setOperation if you implement
  37. * an IComplexOperation).
  38. *
  39. * @since 18.0.0
  40. * @deprecated 18.0.0
  41. */
  42. public function getMatchingOperations(string $class, bool $returnFirstMatchingOperationOnly = true): array;
  43. /**
  44. * @throws RuntimeException
  45. * @since 18.0.0
  46. */
  47. public function getFlows(bool $returnFirstMatchingOperationOnly = true): array;
  48. /**
  49. * this method can only be called once and is typically called by the
  50. * Flow engine, unless for IComplexOperations.
  51. *
  52. * @throws RuntimeException
  53. * @since 18.0.0
  54. */
  55. public function setOperation(IOperation $operation): void;
  56. /**
  57. * this method can only be called once and is typically called by the
  58. * Flow engine, unless for IComplexOperations.
  59. *
  60. * @throws RuntimeException
  61. * @since 18.0.0
  62. */
  63. public function setEntity(IEntity $entity): void;
  64. /**
  65. * returns the entity which might provide more information, depending on
  66. * the interfaces it implements
  67. *
  68. * @return IEntity
  69. * @since 18.0.0
  70. */
  71. public function getEntity(): IEntity;
  72. }