protected function sqlInsert(): string
    {
        $inserts = [];
        foreach ($this->datafields as $fieldname => $field) {
            $value = (array_key_exists($fieldname, $this->values)) ? $this->values[$fieldname] : null;
            $escapedFieldName = $this->dbal->sqlFieldEscape($field['name']);
            $inserts[$escapedFieldName] = $this->dbal->sqlQuote($value, $field['commontype'], true);
        }
        if (! count($inserts)) {
            throw new \LogicException('Recordset: Insert does not have any fields to insert');
        }
        return 'INSERT INTO ' . $this->dbal->sqlTableEscape($this->entity)
        . ' (' . implode(', ', array_keys($inserts)) . ')'
        . ' VALUES (' . implode(', ', $inserts) . ')'
        . ';';
    }
protected function sqlInsert(): string
    {
        $inserts = [];
        foreach ($this->datafields as $fieldname => $field) {
            $value = (array_key_exists($fieldname, $this->values)) ? $this->values[$fieldname] : null;
            $escapedFieldName = $this->dbal->sqlFieldEscape($field['name']);
            $inserts[$escapedFieldName] = $this->dbal->sqlQuote($value, $field['commontype'], true);
        }
        if (! count($inserts)) {
            throw new \LogicException('Recordset: Insert does not have any fields to insert');
        }
        return 'INSERT INTO ' . $this->dbal->sqlTableEscape($this->entity)
        . ' (' . implode(', ', array_keys($inserts)) . ')'
        . ' VALUES (' . implode(', ', $inserts) . ')'
        . ';';
    }
protected function sqlInsert ( ) : string { $ inserts = [ ] ; foreach ( $ this -> datafields as $ fieldname => $ field ) { $ value = ( array_key_exists ( $ fieldname , $ this -> values ) ) ? $ this -> values [ $ fieldname ] : null ; $ escapedFieldName = $ this -> dbal -> sqlFieldEscape ( $ field [ 'name' ] ) ; $ inserts [ $ escapedFieldName ] = $ this -> dbal -> sqlQuote ( $ value , $ field [ 'commontype' ] , true ) ; } if ( ! count ( $ inserts ) ) { throw new \ LogicException ( 'Recordset: Insert does not have any fields to insert' ) ; } return 'INSERT INTO ' . $ this -> dbal -> sqlTableEscape ( $ this -> entity ) . ' (' . implode ( ', ' , array_keys ( $ inserts ) ) . ')' . ' VALUES (' . implode ( ', ' , $ inserts ) . ')' . ';' ; }
Create the sql statement for INSERT INTO
@return string
Create the sql statement for INSERT INTO