/** * @param array $attributes * @return PaytrailPayment */ public static function create(array $attributes) { $model = new PaytrailPayment(); $model->attributes = $attributes; if (!$model->save()) { throw new CException('Failed to save paytrail payment.'); } return $model; }