arogachev / yii2-excel

ActiveRecord import and export based on PHPExcel for Yii 2 framework
Other
64 stars 25 forks source link

Explicitly specify update mode for models with composite primary keys #24

Closed arogachev closed 8 years ago

arogachev commented 8 years ago

For primary keys containing just one column, we can detect mode just by value - was it passed or not.

But for composite primary keys situation is more complicated because in both create and update modes we need to fully specify all primary key values so we need explicitly tell importer that we either creating or updating model.

arogachev commented 8 years ago

Related: https://github.com/arogachev/yii2-excel/issues/18

We can specify loaded primary keys, then the new model will be created. But sometimes we need to create new one using values replacement, so this won't work.