<?php
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
//
// Ice version 3.7.2
//
// <auto-generated>
//
// Generated from file `Transaction.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//


namespace
{
    require_once 'Config.php';
    require_once 'Billing/CurrencyAmount.php';
}

namespace Smartswitch\Billing
{
    global $Smartswitch_Billing__t_TransactionType;
    class TransactionType
    {
        const Refill = 0;
        const WriteOff = 1;
        const Payment = 2;
        const Invoice = 3;
    }

    $Smartswitch_Billing__t_TransactionType = IcePHP_defineEnum('::Smartswitch::Billing::TransactionType', array('Refill', 0, 'WriteOff', 1, 'Payment', 2, 'Invoice', 3));
}

namespace Smartswitch\Billing
{
    global $Smartswitch_Billing__t_Transaction;
    class Transaction
    {
        public function __construct($type=\Smartswitch\Billing\TransactionType::Refill, $date='', $amount=null)
        {
            $this->type = $type;
            $this->date = $date;
            $this->amount = is_null($amount) ? new \Smartswitch\Billing\CurrencyAmount : $amount;
        }

        public function __toString()
        {
            global $Smartswitch_Billing__t_Transaction;
            return IcePHP_stringify($this, $Smartswitch_Billing__t_Transaction);
        }

        public $type;
        public $date;
        public $amount;
    }

    global $Smartswitch_Billing__t_TransactionType;
    global $IcePHP__t_string;
    global $Smartswitch_Billing__t_CurrencyAmount;
    $Smartswitch_Billing__t_Transaction = IcePHP_defineStruct('::Smartswitch::Billing::Transaction', '\\Smartswitch\\Billing\\Transaction', array(
        array('type', $Smartswitch_Billing__t_TransactionType),
        array('date', $IcePHP__t_string),
        array('amount', $Smartswitch_Billing__t_CurrencyAmount)));
}

namespace Smartswitch\Billing
{
    global $Smartswitch_Billing__t_TransactionSequence;

    if(!isset($Smartswitch_Billing__t_TransactionSequence))
    {
        global $Smartswitch_Billing__t_Transaction;
        $Smartswitch_Billing__t_TransactionSequence = IcePHP_defineSequence('::Smartswitch::Billing::TransactionSequence', $Smartswitch_Billing__t_Transaction);
    }
}
?>
