Updated to work with ArrayObject in insert/update/insertOnDuplicateKey