示例#1
0
 /**
  * Node property setter
  *
  * @param string $name  name of the property (public or protected)
  * @param mixed  $value new value of the property
  *
  * @return AeNode self
  */
 public function set($name, $value)
 {
     $name = (string) $name;
     if ($this->propertyExists($name, 'set')) {
         return parent::set($name, $value);
     }
     $this->_properties[$name] = $value;
     return $this;
 }
示例#2
0
 public function set($field, $value = null)
 {
     if ($field instanceof AeScalar || $field instanceof AeArray) {
         $field = $field->getValue();
     }
     // *** Backward compatibility
     if (is_string($field) && $this->propertyExists($field, 'set')) {
         return parent::set($field, $value);
     }
     $field = (array) $field;
     if (!is_array($this->_set) && count($field) > 0) {
         $this->_set = array();
     }
     foreach ($field as $f => $v) {
         $f = $this->field($f);
         // *** $v should be bound explicitly
         $this->_set[] = $f . ' = ' . $v;
     }
     return $this;
 }