/** * @inheritdoc */ public function insert($runValidation = true, $attributeNames = null) { $changedAttributes = $this->getDirtyAttributes($attributeNames); if (empty($changedAttributes)) { $this->afterSave(false, $changedAttributes); return 0; } return parent::insert($runValidation, $attributeNames); }