public static function create(array $attributes)
    {
        $model = new PaymentTransaction;
        $model->attributes = $attributes;
        $model->userIdentifier = isset($attributes['userIdentifier']) ? $attributes['userIdentifier'] : Yii::app()->user->id;
        $model->locale = isset($attributes['locale']) ? $attributes['locale'] : Yii::app()->language;
        if (!$model->save()) {
            throw new CException('Failed to save payment transaction.');
        }
        return $model;
    }
public static function create(array $attributes)
    {
        $model = new PaymentTransaction;
        $model->attributes = $attributes;
        $model->userIdentifier = isset($attributes['userIdentifier']) ? $attributes['userIdentifier'] : Yii::app()->user->id;
        $model->locale = isset($attributes['locale']) ? $attributes['locale'] : Yii::app()->language;
        if (!$model->save()) {
            throw new CException('Failed to save payment transaction.');
        }
        return $model;
    }
public static function create ( array $ attributes ) { $ model = new PaymentTransaction ; $ model -> attributes = $ attributes ; $ model -> userIdentifier = isset ( $ attributes [ 'userIdentifier' ] ) ? $ attributes [ 'userIdentifier' ] : Yii :: app ( ) -> user -> id ; $ model -> locale = isset ( $ attributes [ 'locale' ] ) ? $ attributes [ 'locale' ] : Yii :: app ( ) -> language ; if ( ! $ model -> save ( ) ) { throw new CException ( 'Failed to save payment transaction.' ) ; } return $ model ; }
Creates a new payment transaction.
@param array $attributes
@return PaymentTransaction
@throws CException
Creates a new payment transaction .