Skip to content

EspoCRM – Open Source CRM Application

Fix const name

Yurii202dd8e06e39
diff --git a/application/Espo/Modules/Crm/Entities/Opportunity.php b/application/Espo/Modules/Crm/Entities/Opportunity.php
index 829618e432..c8c1030d79 100644
--- a/application/Espo/Modules/Crm/Entities/Opportunity.php
+++ b/application/Espo/Modules/Crm/Entities/Opportunity.php
@@ -41,9 +41,15 @@ class Opportunity extends Entity
{
public const ENTITY_TYPE = 'Opportunity';
- /** @since 10.0.0 */
+ /**
+ * @deprecated
+ * @todo Remove in v10.1.
+ */
public const string FIELD_CLOSED_DATE = 'closeDate';
+
/** @since 10.0.0 */
+ public const string FIELD_CLOSE_DATE = 'closeDate';
+ /**@since 10.0.0 */
public const string FIELD_STAGE = 'stage';
/** @since 10.0.0 */
public const string FIELD_AMOUNT = 'amount';
@@ -89,12 +95,12 @@ class Opportunity extends Entity
public function getCloseDate(): ?Date
{
/** @var ?Date */
- return $this->getValueObject(self::FIELD_CLOSED_DATE);
+ return $this->getValueObject(self::FIELD_CLOSE_DATE);
}
public function setCloseDate(?Date $closeDate): self
{
- $this->setValueObject(self::FIELD_CLOSED_DATE, $closeDate);
+ $this->setValueObject(self::FIELD_CLOSE_DATE, $closeDate);
return $this;
}
diff --git a/tests/integration/Espo/Tools/Pipeline/PipelineTest.php b/tests/integration/Espo/Tools/Pipeline/PipelineTest.php
index cec83dcc0c..2a97027dd5 100644
--- a/tests/integration/Espo/Tools/Pipeline/PipelineTest.php
+++ b/tests/integration/Espo/Tools/Pipeline/PipelineTest.php
@@ -157,7 +157,7 @@ class PipelineTest extends BaseTestCase
Field::NAME => 'Opp 1',
Field::PIPELINE . 'Id' => $pipeline1->getId(),
Field::PIPELINE_STAGE . 'Id' => $pipeline1->getStages()[0]->getId(),
- Opportunity::FIELD_CLOSED_DATE => Date::fromString('2026-01-01')->toString(),
+ Opportunity::FIELD_CLOSE_DATE => Date::fromString('2026-01-01')->toString(),
Opportunity::FIELD_AMOUNT => 1000,
], CreateParams::create())->getEntity();
@@ -174,7 +174,7 @@ class PipelineTest extends BaseTestCase
Field::NAME => 'Opp 2',
Field::PIPELINE . 'Id' => $pipeline1->getId(),
Field::PIPELINE_STAGE . 'Id' => $pipeline1->getStages()[4]->getId(),
- Opportunity::FIELD_CLOSED_DATE => Date::fromString('2026-01-01')->toString(),
+ Opportunity::FIELD_CLOSE_DATE => Date::fromString('2026-01-01')->toString(),
Opportunity::FIELD_AMOUNT => 1000,
], CreateParams::create())->getEntity();
@@ -184,7 +184,7 @@ class PipelineTest extends BaseTestCase
$opp = $oppService->create((object) [
Field::NAME => 'Opp 3',
- Opportunity::FIELD_CLOSED_DATE => Date::fromString('2026-01-01')->toString(),
+ Opportunity::FIELD_CLOSE_DATE => Date::fromString('2026-01-01')->toString(),
Opportunity::FIELD_AMOUNT => 1000,
], CreateParams::create());