But when it is used in CActiveRecord::update(), those parameters are set to the default values (an empty string and an empty array). That means it can only return 1. So there’s no point in checking the return value.
But once an exception has been thrown, we will have no chance to check the return value of updateByPk() in update() method. Instead of that, we will catch the exception somewhere in our app code and do something, if we need.
This makes sense. Mine failed to update only because I instantiated a new record based on a number of form attributes, and later used these attributes to update a row in the db. Since I’m not calling find() to generate that record, its oldPrimaryKey is not given, and, therefore, failed to update. I guess we should check for oldPrimaryKey before calling updateByPk() in update().