SqlParser\Components\SetOperation::build PHP Méthode

build() public static méthode

public static build ( SetOperation | SetOperation[] $component, array $options = [] ) : string
$component SetOperation | SetOperation[] The component to be built.
$options array Parameters for building.
Résultat string
    public static function build($component, array $options = array())
    {
        if (is_array($component)) {
            return implode(', ', $component);
        } else {
            return $component->column . ' = ' . $component->value;
        }
    }

Usage Example

 /**
  * @return string
  */
 public function build()
 {
     $ret = 'REPLACE ' . $this->options . ' INTO ' . $this->into;
     if ($this->values != NULL && count($this->values) > 0) {
         $ret .= ' VALUES ' . Array2d::build($this->values);
     } elseif ($this->set != NULL && count($this->set) > 0) {
         $ret .= ' SET ' . SetOperation::build($this->set);
     } elseif ($this->select != NULL && strlen($this->select) > 0) {
         $ret .= ' ' . $this->select->build();
     }
     return $ret;
 }
All Usage Examples Of SqlParser\Components\SetOperation::build
SetOperation