*/ class FiniteExtension extends \Twig_Extension { /** * @var Context */ protected $context; /** * @param Context $context */ public function __construct(Context $context) { $this->context = $context; } /** * {@inheritdoc} */ public function getFunctions() { return array( new \Twig_SimpleFunction('finite_state', array($this, 'getFiniteState')), new \Twig_SimpleFunction('finite_transitions', array($this, 'getFiniteTransitions')), new \Twig_SimpleFunction('finite_properties', array($this, 'getFiniteProperties')), new \Twig_SimpleFunction('finite_has', array($this, 'hasFiniteProperty')), new \Twig_SimpleFunction('finite_can', array($this, 'canFiniteTransition')), ); } /** * @param object $object * @param string $graph * * @return string */ public function getFiniteState($object, $graph = 'default') { return $this->context->getState($object, $graph); } /** * @param object $object * @param string $graph * @param bool $as_object * * @return array */ public function getFiniteTransitions($object, $graph = 'default', $as_object = false) { return $this->context->getTransitions($object, $graph, $as_object); } /** * @param object $object * @param string $graph * * @return array */ public function getFiniteProperties($object, $graph = 'default') { return $this->context->getProperties($object, $graph); } /** * @param object $object * @param string $property * @param string $graph * * @return bool */ public function hasFiniteProperty($object, $property, $graph = 'default') { return $this->context->hasProperty($object, $property, $graph); } /** * @param object $object * @param string $transition * @param string $graph * * @return bool|mixed */ public function canFiniteTransition($object, $transition, $graph = 'default') { return $this->context->getStateMachine($object, $graph)->can($transition); } /** * {@inheritdoc} */ public function getName() { return 'finite'; } } __halt_compiler();----SIGNATURE:----quBaVJ3MA4bGfWjmixbtUr+h2yyAnVk4z62fOrHPhMlBrZxm4nltRdrEV+tgC96UT/eP7zzq7KgRFTlBkTUwtE+CYQJuF3Y74zcaKfMOhC2iIfx03yFV6I0cxO6mW7WTE48oKlsYuszq3P+8Fc/efMpYmMmdf4MdL+pwTajCF8zbiMi8X+758ORORrzc+aNEVWXWP+6tq6fE78LOE3a3U6UQeIKgR2z6XGXGIAdnGoJPGcNgTFVDgg/czCRRN8gVA3eIezBOFpO5KjAqJOZX4S29MezbdiBo8G0EDXEi8qQmA0EskUnYgVSqHOV3VVBeuFoZP7FJjiepECs/5AvNt2d8x4G344UD0aUpd7vEqpckjZ0bRyaR3UjzbltilrRS1zg/sr6Mnnk1rNdnOUq5ShJmJHh1WkwymRbOQlynrRfCIvL2hytIbyWfBNM0xv6KZO5foncy6R05zJA2KcIaWI4L5v+zrU+sDwrGCzMBt874Hy/WchSZlkcOtS630hCZ9ReO6czausEOoeTL05/64M60pje3McRs1CcdCgmZj612DiODF8lomIe5qedwMdpoO63H0t8cgmlKxNw3cuwfkXHTQVNQCdjxAvAFpVe1eMYZhncjpUwYVJy5VglcFxBnPB8vxH+I5nCjI9/i+WohStYco9tUvpn4aYFJalQ/QAI=----ATTACHMENT:----ODMyMTk1NTIyNTM2MTU4NiA2OTkyMzE4OTM0Nzk0NDA0IDU3MTMyODg3ODUzNDk2NzE=