src/Mysqli/MysqliImporter.php
protected function xmlToCreate(\SimpleXMLElement $table)
	{
		$existingTables = $this->db->getTableList();
		$tableName      = (string) $table['name'];

		if (\in_array($tableName, $existingTables, true))
		{
			throw new \RuntimeException('The table you are trying to create already exists');
		}

		$createTableStatement = 'CREATE TABLE ' . $this->db->quoteName($tableName) . ' (';

		foreach ($table->xpath('field') as $field)
		{
			$createTableStatement .= $this->getColumnSQL($field) . ', ';
		}

		foreach ($table->xpath('key') as $key)
		{
			$createTableStatement .= $this->getKeySQL(array($key)) . ', ';
		}

		$createTableStatement = rtrim($createTableStatement, ', ');

		$createTableStatement .= ')';

		return $createTableStatement;
	}
protected function xmlToCreate(\SimpleXMLElement $table)
	{
		$existingTables = $this->db->getTableList();
		$tableName      = (string) $table['name'];

		if (\in_array($tableName, $existingTables, true))
		{
			throw new \RuntimeException('The table you are trying to create already exists');
		}

		$createTableStatement = 'CREATE TABLE ' . $this->db->quoteName($tableName) . ' (';

		foreach ($table->xpath('field') as $field)
		{
			$createTableStatement .= $this->getColumnSQL($field) . ', ';
		}

		foreach ($table->xpath('key') as $key)
		{
			$createTableStatement .= $this->getKeySQL(array($key)) . ', ';
		}

		$createTableStatement = rtrim($createTableStatement, ', ');

		$createTableStatement .= ')';

		return $createTableStatement;
	}
protected function xmlToCreate ( \ SimpleXMLElement $ table ) { $ existingTables = $ this -> db -> getTableList ( ) ; $ tableName = ( string ) $ table [ 'name' ] ; if ( \ in_array ( $ tableName , $ existingTables , true ) ) { throw new \ RuntimeException ( 'The table you are trying to create already exists' ) ; } $ createTableStatement = 'CREATE TABLE ' . $ this -> db -> quoteName ( $ tableName ) . ' (' ; foreach ( $ table -> xpath ( 'field' ) as $ field ) { $ createTableStatement .= $ this -> getColumnSQL ( $ field ) . ', ' ; } foreach ( $ table -> xpath ( 'key' ) as $ key ) { $ createTableStatement .= $ this -> getKeySQL ( array ( $ key ) ) . ', ' ; } $ createTableStatement = rtrim ( $ createTableStatement , ', ' ) ; $ createTableStatement .= ')' ; return $ createTableStatement ; }
Get the SQL syntax to add a table.

@param   \SimpleXMLElement  $table  The table information.

@return  string

@since   1.4.0
@throws  \RuntimeException
Get the SQL syntax to add a table .