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

Multiple-graph example doesn't work #122

Open
willemo opened this issue Jun 22, 2016 · 1 comment
Open

Multiple-graph example doesn't work #122

willemo opened this issue Jun 22, 2016 · 1 comment

Comments

@willemo
Copy link

willemo commented Jun 22, 2016

Update:

It wasn't my callback that broke the example, the example doesn't work out of the box. So now my question is: how do I get multiple graphs to work?

Old question:

When I add a simple callback to the multiple-graph example, an exception gets thrown because the object doesn't comply with the StatefulInterface.

To test I changed the payment loader and added this callback:

'callbacks' => [
    'before' => [
        [
            'do' => function(Finite\StatefulInterface $document, Finite\Event\TransitionEvent $e) {
                echo sprintf(
                    "Applying transition \"%s\"\n",
                    $e->getTransition()->getName()
                );
            }
        ],
    ],
],

The resulting exception is:

PHP Fatal error:  Uncaught exception
'Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException'
with message 'Neither the property "finiteState" nor one of the methods
"getFiniteState()", "finiteState()", "isFiniteState()", "hasFiniteState()", "__get()"
exist and have public access in class "Order".'
in vendor/symfony/property-access/PropertyAccessor.php:487

I tried removing the type constraints of the callback, but that didn't help. Any idea how I can get callbacks to work when my object has a different property path?

@willemo willemo changed the title Callbacks don't work in the multiple-graph example Multiple-graph example doesn't work Jun 22, 2016
@willemo
Copy link
Author

willemo commented Jun 23, 2016

I created a possible bugfix: #123

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

No branches or pull requests

1 participant