Please can anyone explain, how does yii skip param work in CDbCommandBuilder::createMultipleInsertCommand ?
i want to override Yii::t() to skip first param and make it bavkward compatible with default Yii::t
Im sorry for mistake, the createMultipleInsertCommand seems cannot be skipped, it only accept schema object and string, i initially think it can as the command builder store the schema with table name in a property, and now i found how to skip param using ReflectionClass, you can check official php docs
According to documentation the commands require the table name
What version of Yii you use?
I test it in my code like that
If I miss the first argument exception will be raised
Without name Argument 2 passed to CDbCommandBuilder::createMultipleInsertCommand()
It’s true that CActiveRecord uses CDbCommandBuilder internally. But CDbCommandBuilder requires a table name as you see in the API reference, and the code inside the CActiveRecord does call the CDbCommandBuilder methods with a table name. Note that every CActiveRecord class has a table name with which the class is related. That’s why you don’t have to specify a table name when you call the CActiveRecord methods.
As for Yii::t(), what you can do is create your own t(), say, John::t(), in which you call Yii:t() with some first parameter.