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