aboutsummaryrefslogtreecommitdiffstats
path: root/Praspel.php
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-22 12:02:15 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-22 12:02:15 +0100
commitc862a7cc3104eb461e9197b5f7ed21eb4a0a71f3 (patch)
tree7449cf9f7f8d772f6a7a8f32f7b5215ef2514319 /Praspel.php
parent1d3d606b8c255c1bcaf4a49031866605898d20f6 (diff)
downloadPraspel-c862a7cc3104eb461e9197b5f7ed21eb4a0a71f3.zip
Praspel-c862a7cc3104eb461e9197b5f7ed21eb4a0a71f3.tar.gz
Praspel-c862a7cc3104eb461e9197b5f7ed21eb4a0a71f3.tar.bz2
New $bindToClass argument on Praspel::interprete.
Bind class when interpreting.
Diffstat (limited to 'Praspel.php')
-rw-r--r--Praspel.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/Praspel.php b/Praspel.php
index 3aa64d8..5a5c563 100644
--- a/Praspel.php
+++ b/Praspel.php
@@ -87,10 +87,11 @@ class Praspel {
* Short interpreter.
*
* @access public
- * @param string $praspel Praspel.
+ * @param string $praspel Praspel.
+ * @param string $bindToClass Classname to bind.
* @return \Hoa\Praspel\Model\Clause
*/
- public static function interprete ( $praspel ) {
+ public static function interprete ( $praspel, $bindToClass = null ) {
static $_compiler = null;
static $_interpreter = null;
@@ -105,6 +106,9 @@ class Praspel {
$ast = $_compiler->parse($praspel);
+ if(null !== $bindToClass)
+ $_interpreter->bindToClass($bindToClass);
+
return $_interpreter->visit($ast);
}