src/Web2All/Table/SaveObjectTrait.php
public function insertIntoDB($nocache=false)
  {
    $query='INSERT INTO '.$this->quote($this->tablename).' (';
    $values=array();
    $fields=array();
    $sql_parts=array();
    foreach ($this->obj_to_db_trans as $obj_prop => $db_field) {
      
      if(isset($this->{$obj_prop})){
        if ($this->{$obj_prop} instanceof Web2All_Table_SQLOperation) {
          // if there are placeholder values, replace the placeholders with the quoted values
          $sqloperation=$this->{$obj_prop};
          $sql_parts[]=$sqloperation->toSQLString();
          foreach ($sqloperation->getPlaceholderValues() as $avalue) {
            $values[]=$avalue;
          }
        }else if ($this->{$obj_prop} instanceof Web2All_Table_SQLOperationList) {
          throw new Exception("Web2All_Table_SaveObjectTrait: can't insert a Web2All_Table_SQLOperationList for key value ".$obj_prop);
          
        }else{
          $values[]=$this->{$obj_prop};
          $sql_parts[]='?';
        }
        
        $fields[]=$this->quote($db_field);
      }
    }
    $query.=implode(',',$fields).') VALUES ('.implode(',',$sql_parts).')';
    if(count($fields)>0){
      $this->db->Execute($query,$values);
    }
  }
public function insertIntoDB($nocache=false)
  {
    $query='INSERT INTO '.$this->quote($this->tablename).' (';
    $values=array();
    $fields=array();
    $sql_parts=array();
    foreach ($this->obj_to_db_trans as $obj_prop => $db_field) {
      
      if(isset($this->{$obj_prop})){
        if ($this->{$obj_prop} instanceof Web2All_Table_SQLOperation) {
          // if there are placeholder values, replace the placeholders with the quoted values
          $sqloperation=$this->{$obj_prop};
          $sql_parts[]=$sqloperation->toSQLString();
          foreach ($sqloperation->getPlaceholderValues() as $avalue) {
            $values[]=$avalue;
          }
        }else if ($this->{$obj_prop} instanceof Web2All_Table_SQLOperationList) {
          throw new Exception("Web2All_Table_SaveObjectTrait: can't insert a Web2All_Table_SQLOperationList for key value ".$obj_prop);
          
        }else{
          $values[]=$this->{$obj_prop};
          $sql_parts[]='?';
        }
        
        $fields[]=$this->quote($db_field);
      }
    }
    $query.=implode(',',$fields).') VALUES ('.implode(',',$sql_parts).')';
    if(count($fields)>0){
      $this->db->Execute($query,$values);
    }
  }
Insert this object into the DB

@param boolean $nocache  [ignored]