Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataObject] add interface for calculated fields #4283

Open
FredoVelcro opened this issue Apr 25, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@FredoVelcro
Copy link

commented Apr 25, 2019

Hello,

Could be nice to add an interface for calculated field as describe here :
https://pimcore.com/docs/5.x/Development_Documentation/Objects/Object_Classes/Data_Types/Calculated_Value_Type.html

For instance :

interface CalculatedFieldInterface
{
    public static function compute($object, $context);
    public static function getCalculatedValueForEditMode($object, $context);
}
@brusch

This comment has been minimized.

Copy link
Member

commented May 3, 2019

Absolutely! It should be also possible to define the calculator class as a service using the @Service\Calculator syntax, like we do for the path formatter (relational data-types) and the options provider (select data-type).

Would you provide a PR for that?

@FredoVelcro

This comment has been minimized.

Copy link
Author

commented May 3, 2019

Great, PR has been submitted !
#4317
Was not sure of adding "getCalculatedValueForEditMode()" in the default interface cause it could be optional..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.