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