OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
37
app/Domain/ContentTemplates/Contracts/Applier.php
Normal file
37
app/Domain/ContentTemplates/Contracts/Applier.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\ContentTemplates\Contracts;
|
||||
|
||||
use Leantime\Domain\ContentTemplates\Models\ContentTemplate;
|
||||
|
||||
/**
|
||||
* Applier — turns a ContentTemplate into rows in the target system.
|
||||
*
|
||||
* Registry holds DEFINITIONS; appliers know how to project those definitions
|
||||
* into the database for a specific target type (canvas items, wiki articles, …).
|
||||
* Each appliesTo value maps to exactly one Applier; appliers self-describe
|
||||
* which appliesTo values they handle via supports().
|
||||
*/
|
||||
interface Applier
|
||||
{
|
||||
/**
|
||||
* @return bool true if this applier handles the given appliesTo value.
|
||||
*/
|
||||
public function supports(string $appliesTo): bool;
|
||||
|
||||
/**
|
||||
* Apply the template's content to the target.
|
||||
*
|
||||
* @param int $targetId ID of the target object (canvas id, wiki id, …).
|
||||
* @param ContentTemplate $template The template to project.
|
||||
* @param array{
|
||||
* userId?: int,
|
||||
* mode?: 'add'|'replace',
|
||||
* } $options Apply-time options.
|
||||
* userId — author/creator id for inserted rows; falls back to session user.
|
||||
* mode — 'add' to keep existing content, 'replace' to delete first.
|
||||
* Defaults to 'add'.
|
||||
* @return int Number of top-level entities created (canvas items, articles, …).
|
||||
*/
|
||||
public function apply(int $targetId, ContentTemplate $template, array $options = []): int;
|
||||
}
|
||||
Reference in New Issue
Block a user