aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}