<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AdvInterCompanyJournalEntryAccountingBookDetail StructType
 * @subpackage Structs
 */
class AdvInterCompanyJournalEntryAccountingBookDetail extends AbstractStructBase
{
    /**
     * The accountingBook
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $accountingBook;
    /**
     * The currency
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $currency;
    /**
     * The subsidiary
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $subsidiary;
    /**
     * The exchangeRate
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var float
     */
    public $exchangeRate;
    /**
     * Constructor method for AdvInterCompanyJournalEntryAccountingBookDetail
     * @uses AdvInterCompanyJournalEntryAccountingBookDetail::setAccountingBook()
     * @uses AdvInterCompanyJournalEntryAccountingBookDetail::setCurrency()
     * @uses AdvInterCompanyJournalEntryAccountingBookDetail::setSubsidiary()
     * @uses AdvInterCompanyJournalEntryAccountingBookDetail::setExchangeRate()
     * @param \StructType\RecordRef $accountingBook
     * @param \StructType\RecordRef $currency
     * @param \StructType\RecordRef $subsidiary
     * @param float $exchangeRate
     */
    public function __construct(\StructType\RecordRef $accountingBook = null, \StructType\RecordRef $currency = null, \StructType\RecordRef $subsidiary = null, $exchangeRate = null)
    {
        $this
            ->setAccountingBook($accountingBook)
            ->setCurrency($currency)
            ->setSubsidiary($subsidiary)
            ->setExchangeRate($exchangeRate);
    }
    /**
     * Get accountingBook value
     * @return \StructType\RecordRef|null
     */
    public function getAccountingBook()
    {
        return $this->accountingBook;
    }
    /**
     * Set accountingBook value
     * @param \StructType\RecordRef $accountingBook
     * @return \StructType\AdvInterCompanyJournalEntryAccountingBookDetail
     */
    public function setAccountingBook(\StructType\RecordRef $accountingBook = null)
    {
        $this->accountingBook = $accountingBook;
        return $this;
    }
    /**
     * Get currency value
     * @return \StructType\RecordRef|null
     */
    public function getCurrency()
    {
        return $this->currency;
    }
    /**
     * Set currency value
     * @param \StructType\RecordRef $currency
     * @return \StructType\AdvInterCompanyJournalEntryAccountingBookDetail
     */
    public function setCurrency(\StructType\RecordRef $currency = null)
    {
        $this->currency = $currency;
        return $this;
    }
    /**
     * Get subsidiary value
     * @return \StructType\RecordRef|null
     */
    public function getSubsidiary()
    {
        return $this->subsidiary;
    }
    /**
     * Set subsidiary value
     * @param \StructType\RecordRef $subsidiary
     * @return \StructType\AdvInterCompanyJournalEntryAccountingBookDetail
     */
    public function setSubsidiary(\StructType\RecordRef $subsidiary = null)
    {
        $this->subsidiary = $subsidiary;
        return $this;
    }
    /**
     * Get exchangeRate value
     * @return float|null
     */
    public function getExchangeRate()
    {
        return $this->exchangeRate;
    }
    /**
     * Set exchangeRate value
     * @param float $exchangeRate
     * @return \StructType\AdvInterCompanyJournalEntryAccountingBookDetail
     */
    public function setExchangeRate($exchangeRate = null)
    {
        // validation for constraint: float
        if (!is_null($exchangeRate) && !(is_float($exchangeRate) || is_numeric($exchangeRate))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($exchangeRate, true), gettype($exchangeRate)), __LINE__);
        }
        $this->exchangeRate = $exchangeRate;
        return $this;
    }
}
