From 57119b19866245aaec5deb0e6be5548fd8a4dc5a Mon Sep 17 00:00:00 2001 From: Paul DelRe Date: Mon, 29 Sep 2025 13:42:39 -0400 Subject: [PATCH 1/5] add `Project::defaultTmId` & `Project::defaultGlossaryId` --- src/CrowdinApiClient/Model/Project.php | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/CrowdinApiClient/Model/Project.php b/src/CrowdinApiClient/Model/Project.php index 2d582344..eed35ebf 100644 --- a/src/CrowdinApiClient/Model/Project.php +++ b/src/CrowdinApiClient/Model/Project.php @@ -242,6 +242,16 @@ class Project extends BaseModel */ protected $notificationSettings = []; + /** + * @var integer + */ + protected $defaultTmId; + + /** + * @var integer + */ + protected $defaultGlossaryId; + public function __construct(array $data = []) { parent::__construct($data); @@ -293,6 +303,8 @@ public function __construct(array $data = []) $this->normalizePlaceholder = (bool)$this->getDataProperty('normalizePlaceholder'); $this->saveMetaInfoInSource = (bool)$this->getDataProperty('saveMetaInfoInSource'); $this->notificationSettings = (array)$this->getDataProperty('notificationSettings'); + $this->defaultTmId = (integer)$this->getDataProperty('defaultTmId'); + $this->defaultGlossaryId = (integer)$this->getDataProperty('defaultGlossaryId'); } /** @@ -1034,4 +1046,36 @@ public function setNotificationSettings(array $notificationSettings): void { $this->notificationSettings = $notificationSettings; } + + /** + * @return int|null + */ + public function getDefaultTmId(): ?int + { + return $this->defaultTmId; + } + + /** + * @param int|null $defaultTmId + */ + public function setDefaultTmId(?int $defaultTmId): void + { + $this->defaultTmId = $defaultTmId; + } + + /** + * @return int|null + */ + public function getDefaultGlossaryId(): ?int + { + return $this->defaultGlossaryId; + } + + /** + * @param int|null $defaultGlossaryId + */ + public function setDefaultGlossaryId(?int $defaultGlossaryId): void + { + $this->defaultGlossaryId = $defaultGlossaryId; + } } From d2f05cb771b62e0d6dfd07af85fa0fa76814640a Mon Sep 17 00:00:00 2001 From: Paul DelRe Date: Mon, 29 Sep 2025 13:42:57 -0400 Subject: [PATCH 2/5] update tests --- tests/CrowdinApiClient/Model/ProjectTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/CrowdinApiClient/Model/ProjectTest.php b/tests/CrowdinApiClient/Model/ProjectTest.php index d47b541d..3ce9f6cd 100644 --- a/tests/CrowdinApiClient/Model/ProjectTest.php +++ b/tests/CrowdinApiClient/Model/ProjectTest.php @@ -141,6 +141,8 @@ class ProjectTest extends TestCase ], 'joinPolicy' => null, 'visibility' => null, + 'defaultTmId' => 10, + 'defaultGlossaryId' => 20, ]; public function testLoadData() @@ -214,5 +216,7 @@ public function checkData() $this->assertEquals($this->data['normalizePlaceholder'], $this->project->isNormalizePlaceholder()); $this->assertEquals($this->data['saveMetaInfoInSource'], $this->project->isSaveMetaInfoInSource()); $this->assertEquals($this->data['notificationSettings'], $this->project->getNotificationSettings()); + $this->assertEquals($this->data['defaultTmId'], $this->project->getDefaultTmId()); + $this->assertEquals($this->data['defaultGlossaryId'], $this->project->getDefaultGlossaryId()); } } From 6d8bf5bf31f4a4fb1f180d8a5438220fe2c61874 Mon Sep 17 00:00:00 2001 From: Paul DelRe Date: Mon, 29 Sep 2025 13:43:09 -0400 Subject: [PATCH 3/5] update doctag info --- src/CrowdinApiClient/Api/ProjectApi.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CrowdinApiClient/Api/ProjectApi.php b/src/CrowdinApiClient/Api/ProjectApi.php index 214e9c9f..b9ef7700 100644 --- a/src/CrowdinApiClient/Api/ProjectApi.php +++ b/src/CrowdinApiClient/Api/ProjectApi.php @@ -69,7 +69,9 @@ public function get(int $projectId): ?Project * boolean $data[skipUntranslatedStrings]
* boolean $data[skipUntranslatedFiles]
* integer $data[exportWithMinApprovalsCount]
- * integer $data[exportApprovedOnly] + * integer $data[exportApprovedOnly]
+ * integer $data[defaultTmId]
+ * integer $data[defaultGlossaryId] * @return Project|null */ public function create(array $data): ?Project From f99601eaf854099b92a54a94c454b183f1920db7 Mon Sep 17 00:00:00 2001 From: Paul DelRe Date: Fri, 3 Oct 2025 09:18:19 -0400 Subject: [PATCH 4/5] add tests for `setDefaultTmId` & `setDefaultGlossaryId` --- tests/CrowdinApiClient/Model/ProjectTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/CrowdinApiClient/Model/ProjectTest.php b/tests/CrowdinApiClient/Model/ProjectTest.php index 3ce9f6cd..64699fe0 100644 --- a/tests/CrowdinApiClient/Model/ProjectTest.php +++ b/tests/CrowdinApiClient/Model/ProjectTest.php @@ -159,12 +159,16 @@ public function testSetData() $this->project->setTargetLanguageIds(['uk']); $this->project->setLanguageAccessPolicy('moderate'); $this->project->setDescription($this->data['description']); + $this->project->setDefaultTmId($this->data['defaultTmId']); + $this->project->setDefaultGlossaryId($this->data['defaultGlossaryId']); $this->assertEquals($this->data['name'], $this->project->getName()); $this->assertEquals($this->data['cname'], $this->project->getCname()); $this->assertEquals($this->data['description'], $this->project->getDescription()); $this->assertEquals(['uk'], $this->project->getTargetLanguageIds()); $this->assertEquals('moderate', $this->project->getLanguageAccessPolicy()); + $this->assertEquals($this->data['defaultTmId'], $this->project->getDefaultTmId()); + $this->assertEquals($this->data['defaultGlossaryId'], $this->project->setDefaultGlossaryId()); } public function checkData() From ec3809f9d17b8b4f55cc03d31bdac45b3220da7a Mon Sep 17 00:00:00 2001 From: Paul DelRe Date: Fri, 3 Oct 2025 09:24:39 -0400 Subject: [PATCH 5/5] fix copy/paste typo --- tests/CrowdinApiClient/Model/ProjectTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CrowdinApiClient/Model/ProjectTest.php b/tests/CrowdinApiClient/Model/ProjectTest.php index 64699fe0..c850e508 100644 --- a/tests/CrowdinApiClient/Model/ProjectTest.php +++ b/tests/CrowdinApiClient/Model/ProjectTest.php @@ -168,7 +168,7 @@ public function testSetData() $this->assertEquals(['uk'], $this->project->getTargetLanguageIds()); $this->assertEquals('moderate', $this->project->getLanguageAccessPolicy()); $this->assertEquals($this->data['defaultTmId'], $this->project->getDefaultTmId()); - $this->assertEquals($this->data['defaultGlossaryId'], $this->project->setDefaultGlossaryId()); + $this->assertEquals($this->data['defaultGlossaryId'], $this->project->getDefaultGlossaryId()); } public function checkData()