OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Leantime\Domain\Entityrelations\Services;
use Leantime\Domain\Setting\Repositories\Setting;
class Entityrelations
{
/**
* Class constructor.
*
* @param Setting $settingsRepo The settings repository.
* @return void
*/
public function __construct(
private Setting $settingsRepo
) {}
public function saveRelationship($entityA, $entityAType, $relationship, $entityB, $entityBType, string $meta = ''): mixed
{
// FIXME(phpstan-l2): this method is broken. Setting::saveSetting() is (string $type,
// mixed $value) — only the first two args were ever persisted; $relationship/$entityB/
// $entityBType/$meta were silently dropped by PHP. The injected EntityrelationRepository
// ($entityRelationshipsRepo) also has no matching 6-arg method. Trimmed to preserve
// current runtime behavior; the relationship-storage design needs to be rebuilt.
return $this->settingsRepo->saveSetting($entityA, $entityAType);
}
public function getRelationshipByEntity(string $entitySide, int $entity, string $entityType, string $relationship): mixed
{
// FIXME(phpstan-l2): broken counterpart of saveRelationship() — Setting::getSetting() is
// (string $type, mixed $default = false); the extra args were silently dropped. Trimmed
// to preserve current runtime behavior. Needs a real entity-relationship store.
return $this->settingsRepo->getSetting($entitySide, $entity);
}
}