0.01], [['provider', 'status'], 'string', 'max' => 32], [['provider_subscription_id'], 'string', 'max' => 190], [['currency'], 'string', 'max' => 8], [['interval_unit'], 'string', 'max' => 16], ]; } public function beforeSave($insert) { if (!parent::beforeSave($insert)) { return false; } $now = date('Y-m-d H:i:s'); if ($insert && empty($this->created_at)) { $this->created_at = $now; } $this->updated_at = $now; if (empty($this->currency)) { $this->currency = 'USD'; } return true; } }