public function insert($table, array $data, array $types = [])
    {
        return $this->getDisconnectRetry()->run(function () use ($table, $data, $types) {
            $columns = array_keys($data);

            return $this->newQuery()->insert($columns, $types)
                ->into($table)
                ->values($data)
                ->execute();
        });
    }
public function insert($table, array $data, array $types = [])
    {
        return $this->getDisconnectRetry()->run(function () use ($table, $data, $types) {
            $columns = array_keys($data);

            return $this->newQuery()->insert($columns, $types)
                ->into($table)
                ->values($data)
                ->execute();
        });
    }
public function insert ( $ table , array $ data , array $ types = [ ] ) { return $ this -> getDisconnectRetry ( ) -> run ( function ( ) use ( $ table , $ data , $ types ) { $ columns = array_keys ( $ data ) ; return $ this -> newQuery ( ) -> insert ( $ columns , $ types ) -> into ( $ table ) -> values ( $ data ) -> execute ( ) ; } ) ; }
Executes an INSERT query on the specified table.

@param string $table the table to insert values in
@param array $data values to be inserted
@param array $types list of associative array containing the types to be used for casting
@return \Cake\Database\StatementInterface
Executes an INSERT query on the specified table .