Esempio n. 1
0
 /**
  * Setter for value
  *
  * @param mixed
  * @return
  */
 public function setValue($value, $updateNode = TRUE, $updateVarType = TRUE)
 {
     $this->value = $value;
     if ($updateNode) {
         $props = $this->node->getProps();
         $valueNode = Tx_PhpParser_Parser_NodeFactory::buildNodeFromValue($value);
         $props[0]->setDefault($valueNode);
         $this->node->setProps($props);
     }
     if ($updateVarType) {
         $varType = Tx_PhpParser_Parser_Utility_NodeConverter::getVarTypeFromValue($value);
         if (!empty($varType)) {
             $this->setVarType($varType);
         }
     }
     return $this;
 }