Created
June 12, 2011 15:53
-
-
Save francescoagati/1021693 to your computer and use it in GitHub Desktop.
transition with idiorm php pharen and lambda function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(fn transiction (callback) | |
(-> (:: ORM get_db) (beginTransaction)) | |
($callback ORM) | |
(-> (:: ORM get_db) (commit)) | |
) | |
(transition (lambda (orm) (print_r orm))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('/Users/Francesco/Downloads/Scriptor-pharen-aea8dc4/lang.php'); | |
Lexical::$scopes['bindings'] = array(); | |
function transiction($callback){ | |
ORM::$get_db->beginTransaction(); | |
(is_string($callback)?$callback(ORM):$callback[0](ORM, $callback[1])); | |
return ORM::$get_db->commit(); | |
} | |
function bindings__lambdafunc7($orm, $__closure_id){ | |
return print_r($orm); | |
} | |
transition(array("bindings__lambdafunc7", Lexical::get_closure_id("bindings", Null))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment