Files

25 lines
825 B
PHP
Raw Permalink Normal View History

<?php
declare( strict_types=1 );
namespace StreamGoals\Overlay;
/** Optional capability: donation actions (rewards). Sources without it simply show no actions. */
interface ActionsSource {
/**
* Enabled actions for the goal (goal_id = $goalId or 0), already filtered to the effective minimum and ordered.
* Raw rows with keys title, description, amount_minor, mode.
*
* @return array<int,array<string,mixed>>
*/
public function menuActions( int $goalId ): array;
/**
* Triggered actions per donation (sg_action_events), in trigger order. One lookup for the whole page.
* Raw rows with keys title, times; Payloads sanitizes them.
*
* @param int[] $donationIds
* @return array<int,array<int,array<string,mixed>>> donation id => events
*/
public function actionsFor( array $donationIds ): array;
}