public function afterSave($insert, $changedAttributes) { $this->toggleWebhook(); return parent::afterSave($insert, $changedAttributes); }
/** * Update member card after save member. * @see \yii\db\BaseActiveRecord::afterSave($insert, $changedAttributes) */ public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { $this->attachBehavior('MembershipDiscountBehavior', new MembershipDiscountBehavior()); $this->operationCoupon($this); } }
/** * Update member card after save member. * @see \yii\db\BaseActiveRecord::afterSave($insert, $changedAttributes) */ public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { $member = Member::findByPk($this->memberId); if (!empty($member)) { $member->upgradeCard(); } } }