Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/Models/DataObject/DataObjectServiceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\DataObject\ClassDefinition\Data;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Data\CalculatedValue;
use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData as FieldCollectionData;
use Pimcore\Model\DataObject\Objectbrick\Data\AbstractData as ObjectbrickData;
use Pimcore\Model\DataObject\Service;
use Pimcore\Model\DataObject\Service as PimcoreDataObjectService;
use Pimcore\Model\User;

/**
Expand Down Expand Up @@ -50,4 +54,19 @@
): void {
Service::enrichLayoutPermissions($layout, $allowedView, $allowedEdit, $user);
}

public function getCalculatedFieldValue(
FieldCollectionData|ObjectbrickData|Concrete $object,
?CalculatedValue $data,
): mixed {
return PimcoreDataObjectService::getCalculatedFieldValue($object, $data);

Check warning on line 62 in src/Models/DataObject/DataObjectServiceResolver.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Models/DataObject/DataObjectServiceResolver.php#L62

Avoid using static access to class '\Pimcore\Model\DataObject\Service' in method 'getCalculatedFieldValue'.
}

public function getCalculatedFieldValueForEditMode(
Concrete $object,
array $params,
?CalculatedValue $data,
): ?string {
return PimcoreDataObjectService::getCalculatedFieldValueForEditMode($object, $params, $data);

Check warning on line 70 in src/Models/DataObject/DataObjectServiceResolver.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Models/DataObject/DataObjectServiceResolver.php#L70

Avoid using static access to class '\Pimcore\Model\DataObject\Service' in method 'getCalculatedFieldValueForEditMode'.
}
}
15 changes: 15 additions & 0 deletions src/Models/DataObject/DataObjectServiceResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\DataObject\ClassDefinition\Data;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Data\CalculatedValue;
use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData as FieldCollectionData;
use Pimcore\Model\DataObject\Objectbrick\Data\AbstractData as ObjectbrickData;
use Pimcore\Model\User;

/**
Expand All @@ -43,4 +46,16 @@
array $allowedEdit,
?User $user = null
): void;


public function getCalculatedFieldValue(
FieldCollectionData|ObjectbrickData|Concrete $object,
?CalculatedValue $data,
): mixed;

Check notice on line 54 in src/Models/DataObject/DataObjectServiceResolverInterface.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Models/DataObject/DataObjectServiceResolverInterface.php#L54

Expected 2 blank lines after function; 1 found

public function getCalculatedFieldValueForEditMode(

Check notice on line 56 in src/Models/DataObject/DataObjectServiceResolverInterface.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Models/DataObject/DataObjectServiceResolverInterface.php#L56

Expected 2 blank lines before function; 1 found
Concrete $object,
array $params,
?CalculatedValue $data,
): ?string;

Check notice on line 60 in src/Models/DataObject/DataObjectServiceResolverInterface.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Models/DataObject/DataObjectServiceResolverInterface.php#L60

Expected 2 blank lines after function; 0 found
}
Loading