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

Implement the system like Workflow is implemented #8

Open
2 tasks
Aerendir opened this issue Jan 18, 2018 · 0 comments
Open
2 tasks

Implement the system like Workflow is implemented #8

Aerendir opened this issue Jan 18, 2018 · 0 comments

Comments

@Aerendir
Copy link
Owner

Aerendir commented Jan 18, 2018

In Workflow Component there is the Workflow service that makes possible to do something lie this:

$post = new BlogPost();
$workflow = $registry->get($post);

$workflow->can($post, 'publish'); // False
$workflow->can($post, 'to_review'); // True

$workflow->apply($post, 'to_review');
$workflow->can($post, 'publish'); // True
$workflow->getEnabledTransitions($post); // ['publish', 'reject']

Here in Subscription we should be able to do something like this:

$subscription = $entity->getSubscription();
$set = $registry->get('feature_set');

$set->has($subscription, 'publish'); // False

$set->apply($subscription, 'to_review');
$set->getEnabledFeatures(subscription);

// ecc...

The Subscription has to be stored as a json string directly in the entity that uses the subscription and not in a separate table.

This makes possible to completely remove the table storing the subscriptions and avoid unuseful duplicates of rows.

In fact, this structure often causes that a subscription row is required for each corresponding entity (like what happens in our apps that handle redirects).

v0.12.0

  • Start deprecating current methods of FeaturesManager and create a SubscriptionManager (to evaluate)
    ...
  • Move this issue to milestone 0.13.0

v0.13.0

Not planned yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant