Using On Duplicate With Query Builder

Hello. Is it possible to write this query


INSERT ... ON DUPLICATE KEY UPDATE

with DAO style? Like this


createCommand()->insert(...)->onUpdate(...)

Note :

I’m not using this :

createCommand(INSERT … ON DUPLICATE KEY UPDATE)

Because SQL will contain some variables if i use these functions (insert(), select() etc.) it’s automatically securing these variables (escaping). Safer way for me.