MysqliDb::_buildInsertQuery PHP Method

_buildInsertQuery() protected method

Abstraction method that will build an INSERT or UPDATE part of the query
protected _buildInsertQuery ( array $tableData )
$tableData array
    protected function _buildInsertQuery($tableData)
    {
        if (!is_array($tableData)) {
            return;
        }
        $isInsert = preg_match('/^[INSERT|REPLACE]/', $this->_query);
        $dataColumns = array_keys($tableData);
        if ($isInsert) {
            if (isset($dataColumns[0])) {
                $this->_query .= ' (`' . implode($dataColumns, '`, `') . '`) ';
            }
            $this->_query .= ' VALUES (';
        } else {
            $this->_query .= " SET ";
        }
        $this->_buildDataPairs($tableData, $dataColumns, $isInsert);
        if ($isInsert) {
            $this->_query .= ')';
        }
    }