Skip to content

[Workflow] handle enum status properties #58579

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

Closed
tdumalin opened this issue Oct 16, 2024 · 1 comment
Closed

[Workflow] handle enum status properties #58579

tdumalin opened this issue Oct 16, 2024 · 1 comment
Labels

Comments

@tdumalin
Copy link

Description

If we take the Post sample from the doc: https://symfony.com/doc/current/workflow.html, it would be nice to define the currentPlace as an enum property

Example

# config/packages/workflow.yaml
framework:
    workflows:
            marking_store:
                type: 'method'
                property: 'currentPlace'
                enum: true # maybe add a config key to specifiy if the property is an enum but idealy read property reflexion to autoset
// src/Enum/BlogPostPlaces

namespace App\Enum;

enum BlogPostPlaces: string
{
    case Draft = 'draft';
    case Reviewed = 'reviewed';
    //...
}
// src/Entity/BlogPost.php
namespace App\Entity;

class BlogPost
{
    // the configured marking store property must be declared
    private BlogPostPlaces $currentPlace = BlogPostPlaces::Draft;
}
@xabbuh
Copy link
Member

xabbuh commented Oct 16, 2024

Please read the previous discussions on why this isn't implemented (see e.g. #44211, #54582, #57193). I am closing for the reasons stated there. Thank you for understanding.

@xabbuh xabbuh closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants