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

Add simple custom transformers #1

Open
rudiedirkx opened this issue Mar 28, 2016 · 0 comments
Open

Add simple custom transformers #1

rudiedirkx opened this issue Mar 28, 2016 · 0 comments

Comments

@rudiedirkx
Copy link
Owner

Let's say a Feature Context wants to save objects, not ids. Saving shouldn't be a problem, but loading them into a string is. A custom transformer in that Feature Context can fix that. Save objects, print scalars.

In a Feature Context hook:

VariablesDatabase::addTransformer('bla', function(name, value, step) {
  return $value->id;
});

Transformer methods: add, remove, clear.

Like variables, transformers will be cleared after very feature.

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