src/Squid/MySql/Impl/Command/CmdInsert.php
protected function generate()
	{
		if (!$this->getPart(CmdInsert::PART_INTO))
			throw new SquidException('Target table must be defined for Insert command. ' .
				'into() was not called or called with empty value');
		
		$command =  'INSERT ' . 
			($this->getPart(CmdInsert::PART_IGNORE) ? 'IGNORE ' : '') . 
			'INTO `' . $this->getPart(CmdInsert::PART_INTO) . '` ';
		
		if ($this->fields)
		{
			$command .= '(`' . implode('`,`', $this->fields) . '`) ';
		}
		
		$as = $this->getPart(CmdInsert::PART_AS);
		
		if ($as)
		{
			return $command . $as;
		}
		
		return $command . Assembly::append('VALUES', $this->getPart(CmdInsert::PART_VALUES), ', ');
	}
protected function generate()
	{
		if (!$this->getPart(CmdInsert::PART_INTO))
			throw new SquidException('Target table must be defined for Insert command. ' .
				'into() was not called or called with empty value');
		
		$command =  'INSERT ' . 
			($this->getPart(CmdInsert::PART_IGNORE) ? 'IGNORE ' : '') . 
			'INTO `' . $this->getPart(CmdInsert::PART_INTO) . '` ';
		
		if ($this->fields)
		{
			$command .= '(`' . implode('`,`', $this->fields) . '`) ';
		}
		
		$as = $this->getPart(CmdInsert::PART_AS);
		
		if ($as)
		{
			return $command . $as;
		}
		
		return $command . Assembly::append('VALUES', $this->getPart(CmdInsert::PART_VALUES), ', ');
	}
protected function generate ( ) { if ( ! $ this -> getPart ( CmdInsert :: PART_INTO ) ) throw new SquidException ( 'Target table must be defined for Insert command. ' . 'into() was not called or called with empty value' ) ; $ command = 'INSERT ' . ( $ this -> getPart ( CmdInsert :: PART_IGNORE ) ? 'IGNORE ' : '' ) . 'INTO `' . $ this -> getPart ( CmdInsert :: PART_INTO ) . '` ' ; if ( $ this -> fields ) { $ command .= '(`' . implode ( '`,`' , $ this -> fields ) . '`) ' ; } $ as = $ this -> getPart ( CmdInsert :: PART_AS ) ; if ( $ as ) { return $ command . $ as ; } return $ command . Assembly :: append ( 'VALUES' , $ this -> getPart ( CmdInsert :: PART_VALUES ) , ', ' ) ; }
Combined all the parts into one sql.
@return string Created query.
Combined all the parts into one sql .