Browse code

fixed Twig_Node_Set

git-svn-id: http://svn.twig-project.org/trunk@219 93ef8e89-cb99-4229-a87c-7fa0fa45744b

fabien authored on 08/01/2010 15:01:33
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-class Twig_Node_Set extends Twig_Node
3
+class Twig_Node_Set extends Twig_Node implements Twig_NodeListInterface
4 4
 {
5 5
   protected $names;
6 6
   protected $values;
... ...
@@ -30,6 +30,23 @@ class Twig_Node_Set extends Twig_Node
30 30
     return implode("\n", $repr);
31 31
   }
32 32
 
33
+  public function getNodes()
34
+  {
35
+    if ($this->isMultitarget)
36
+    {
37
+      return $this->values;
38
+    }
39
+    else
40
+    {
41
+      return array($this->values);
42
+    }
43
+  }
44
+
45
+  public function setNodes(array $nodes)
46
+  {
47
+    $this->values = $this->isMultitarget ? $nodes : $nodes[0];
48
+  }
49
+
33 50
   public function compile($compiler)
34 51
   {
35 52
     $compiler->addDebugInfo($this);