23 lines
675 B
PHP
23 lines
675 B
PHP
<?php
|
|||
|
|
declare( strict_types=1 );
|
||
|
|
|
||
|
|
namespace StreamGoals\Overlay;
|
||
|
|
|
||
|
|
/** Optional capability: goal tiers (milestones). Sources without it behave as if no goal had tiers. */
|
||
|
|
interface TiersSource {
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Tiers of a goal ordered by target ascending. Rows with keys id, target_minor, title, description, reached_at.
|
||
|
|
*
|
||
|
|
* @return array<int,array<string,mixed>>
|
||
|
|
*/
|
||
|
|
public function tiersFor( int $goalId ): array;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Tiers unlocked by each donation, ONE lookup for the whole page: donation id => [ {title} ].
|
||
|
|
*
|
||
|
|
* @param int[] $donationIds
|
||
|
|
* @return array<int,array<int,array<string,mixed>>>
|
||
|
|
*/
|
||
|
|
public function tiersReachedFor( array $donationIds ): array;
|
||
|
|
}
|