public static function insert($tableName, array $recordData)
    {
        if ($tableName === '') {
            throw new \InvalidArgumentException('The table name must not be empty.', 1331315544);
        }
        if (empty($recordData)) {
            throw new \InvalidArgumentException('$recordData must not be empty.', 1331315553);
        }

        self::enableQueryLogging();
        $dbResult = self::getDatabaseConnection()->exec_INSERTquery(
            $tableName,
            $recordData
        );
        if (!$dbResult) {
            throw new \Tx_Phpunit_Exception_Database(1334439765);
        }

        return self::getDatabaseConnection()->sql_insert_id();
    }
public static function insert($tableName, array $recordData)
    {
        if ($tableName === '') {
            throw new \InvalidArgumentException('The table name must not be empty.', 1331315544);
        }
        if (empty($recordData)) {
            throw new \InvalidArgumentException('$recordData must not be empty.', 1331315553);
        }

        self::enableQueryLogging();
        $dbResult = self::getDatabaseConnection()->exec_INSERTquery(
            $tableName,
            $recordData
        );
        if (!$dbResult) {
            throw new \Tx_Phpunit_Exception_Database(1334439765);
        }

        return self::getDatabaseConnection()->sql_insert_id();
    }
public static function insert ( $ tableName , array $ recordData ) { if ( $ tableName === '' ) { throw new \ InvalidArgumentException ( 'The table name must not be empty.' , 1331315544 ) ; } if ( empty ( $ recordData ) ) { throw new \ InvalidArgumentException ( '$recordData must not be empty.' , 1331315553 ) ; } self :: enableQueryLogging ( ) ; $ dbResult = self :: getDatabaseConnection ( ) -> exec_INSERTquery ( $ tableName , $ recordData ) ; if ( ! $ dbResult ) { throw new \ Tx_Phpunit_Exception_Database ( 1334439765 ) ; } return self :: getDatabaseConnection ( ) -> sql_insert_id ( ) ; }
Executes an INSERT query.

@param string $tableName
the name of the table in which the record should be created,
must not be empty
@param array $recordData
key/value pairs of the record to insert, must not be empty

@return int
the UID of the created record, will be 0 if the table has no UID column

@throws \InvalidArgumentException
@throws \Tx_Phpunit_Exception_Database if an error has occurred
Executes an INSERT query .