BusinessRule
Marks a class as a declarative business rule. Generic attribute to annotate a business rule with its event, the entities it applies to, and its execution priority. Note: the runtime that consumed this attribute (RuleScanner) was removed as incomplete; the attribute is kept as an inert primitive for future use.
BusinessRule::__construct()
public function __construct(string $event = 'pre.operation', array $entities = [], Milpa\app\Enums\ListenerPriority|int $priority = Milpa\app\Enums\ListenerPriority::HIGH, ?string $description = null, bool $enabled = true):Parameters
| Nombre | Tipo | Descripción |
|---|---|---|
| $event | string | Event to subscribe to (default: 'pre.operation') |
| $entities | array<int, class-string> | Entity classes this rule applies to |
| $priority | (int | ListenerPriority) | Execution priority |
| $description | (string | null) | Human-readable description of the rule |
| $enabled | bool | Whether the rule is enabled |
BusinessRule::getPriority()
public function getPriority(): intGet the numeric priority value.