<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CustomerSubsidiaryRelationshipSearchRowBasic StructType
 * @subpackage Structs
 */
class CustomerSubsidiaryRelationshipSearchRowBasic extends SearchRowBasic
{
    /**
     * The balance
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnDoubleField[]
     */
    public $balance;
    /**
     * The depositbalance
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnDoubleField[]
     */
    public $depositbalance;
    /**
     * The entity
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $entity;
    /**
     * The externalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $externalId;
    /**
     * The internalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $internalId;
    /**
     * The isprimarysub
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $isprimarysub;
    /**
     * The primaryCurrency
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $primaryCurrency;
    /**
     * The subsidiary
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $subsidiary;
    /**
     * The unbilledorders
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnDoubleField[]
     */
    public $unbilledorders;
    /**
     * The customFieldList
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\SearchColumnCustomFieldList
     */
    public $customFieldList;
    /**
     * Constructor method for CustomerSubsidiaryRelationshipSearchRowBasic
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setBalance()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setDepositbalance()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setEntity()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setExternalId()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setInternalId()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setIsprimarysub()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setPrimaryCurrency()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setSubsidiary()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setUnbilledorders()
     * @uses CustomerSubsidiaryRelationshipSearchRowBasic::setCustomFieldList()
     * @param \StructType\SearchColumnDoubleField[] $balance
     * @param \StructType\SearchColumnDoubleField[] $depositbalance
     * @param \StructType\SearchColumnSelectField[] $entity
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnBooleanField[] $isprimarysub
     * @param \StructType\SearchColumnSelectField[] $primaryCurrency
     * @param \StructType\SearchColumnSelectField[] $subsidiary
     * @param \StructType\SearchColumnDoubleField[] $unbilledorders
     * @param \StructType\SearchColumnCustomFieldList $customFieldList
     */
    public function __construct(array $balance = array(), array $depositbalance = array(), array $entity = array(), array $externalId = array(), array $internalId = array(), array $isprimarysub = array(), array $primaryCurrency = array(), array $subsidiary = array(), array $unbilledorders = array(), \StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this
            ->setBalance($balance)
            ->setDepositbalance($depositbalance)
            ->setEntity($entity)
            ->setExternalId($externalId)
            ->setInternalId($internalId)
            ->setIsprimarysub($isprimarysub)
            ->setPrimaryCurrency($primaryCurrency)
            ->setSubsidiary($subsidiary)
            ->setUnbilledorders($unbilledorders)
            ->setCustomFieldList($customFieldList);
    }
    /**
     * Get balance value
     * @return \StructType\SearchColumnDoubleField[]|null
     */
    public function getBalance()
    {
        return $this->balance;
    }
    /**
     * This method is responsible for validating the values passed to the setBalance method
     * This method is willingly generated in order to preserve the one-line inline validation within the setBalance method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateBalanceForArrayConstraintsFromSetBalance(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicBalanceItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicBalanceItem instanceof \StructType\SearchColumnDoubleField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicBalanceItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicBalanceItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicBalanceItem), var_export($customerSubsidiaryRelationshipSearchRowBasicBalanceItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The balance property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set balance value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField[] $balance
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setBalance(array $balance = array())
    {
        // validation for constraint: array
        if ('' !== ($balanceArrayErrorMessage = self::validateBalanceForArrayConstraintsFromSetBalance($balance))) {
            throw new \InvalidArgumentException($balanceArrayErrorMessage, __LINE__);
        }
        $this->balance = $balance;
        return $this;
    }
    /**
     * Add item to balance value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToBalance(\StructType\SearchColumnDoubleField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnDoubleField) {
            throw new \InvalidArgumentException(sprintf('The balance property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->balance[] = $item;
        return $this;
    }
    /**
     * Get depositbalance value
     * @return \StructType\SearchColumnDoubleField[]|null
     */
    public function getDepositbalance()
    {
        return $this->depositbalance;
    }
    /**
     * This method is responsible for validating the values passed to the setDepositbalance method
     * This method is willingly generated in order to preserve the one-line inline validation within the setDepositbalance method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateDepositbalanceForArrayConstraintsFromSetDepositbalance(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicDepositbalanceItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicDepositbalanceItem instanceof \StructType\SearchColumnDoubleField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicDepositbalanceItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicDepositbalanceItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicDepositbalanceItem), var_export($customerSubsidiaryRelationshipSearchRowBasicDepositbalanceItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The depositbalance property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set depositbalance value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField[] $depositbalance
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setDepositbalance(array $depositbalance = array())
    {
        // validation for constraint: array
        if ('' !== ($depositbalanceArrayErrorMessage = self::validateDepositbalanceForArrayConstraintsFromSetDepositbalance($depositbalance))) {
            throw new \InvalidArgumentException($depositbalanceArrayErrorMessage, __LINE__);
        }
        $this->depositbalance = $depositbalance;
        return $this;
    }
    /**
     * Add item to depositbalance value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToDepositbalance(\StructType\SearchColumnDoubleField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnDoubleField) {
            throw new \InvalidArgumentException(sprintf('The depositbalance property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->depositbalance[] = $item;
        return $this;
    }
    /**
     * Get entity value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getEntity()
    {
        return $this->entity;
    }
    /**
     * This method is responsible for validating the values passed to the setEntity method
     * This method is willingly generated in order to preserve the one-line inline validation within the setEntity method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateEntityForArrayConstraintsFromSetEntity(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicEntityItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicEntityItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicEntityItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicEntityItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicEntityItem), var_export($customerSubsidiaryRelationshipSearchRowBasicEntityItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The entity property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set entity value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $entity
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setEntity(array $entity = array())
    {
        // validation for constraint: array
        if ('' !== ($entityArrayErrorMessage = self::validateEntityForArrayConstraintsFromSetEntity($entity))) {
            throw new \InvalidArgumentException($entityArrayErrorMessage, __LINE__);
        }
        $this->entity = $entity;
        return $this;
    }
    /**
     * Add item to entity value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToEntity(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The entity property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->entity[] = $item;
        return $this;
    }
    /**
     * Get externalId value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getExternalId()
    {
        return $this->externalId;
    }
    /**
     * This method is responsible for validating the values passed to the setExternalId method
     * This method is willingly generated in order to preserve the one-line inline validation within the setExternalId method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateExternalIdForArrayConstraintsFromSetExternalId(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicExternalIdItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicExternalIdItem), var_export($customerSubsidiaryRelationshipSearchRowBasicExternalIdItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The externalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set externalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setExternalId(array $externalId = array())
    {
        // validation for constraint: array
        if ('' !== ($externalIdArrayErrorMessage = self::validateExternalIdForArrayConstraintsFromSetExternalId($externalId))) {
            throw new \InvalidArgumentException($externalIdArrayErrorMessage, __LINE__);
        }
        $this->externalId = $externalId;
        return $this;
    }
    /**
     * Add item to externalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToExternalId(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The externalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->externalId[] = $item;
        return $this;
    }
    /**
     * Get internalId value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getInternalId()
    {
        return $this->internalId;
    }
    /**
     * This method is responsible for validating the values passed to the setInternalId method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInternalId method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInternalIdForArrayConstraintsFromSetInternalId(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicInternalIdItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicInternalIdItem), var_export($customerSubsidiaryRelationshipSearchRowBasicInternalIdItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The internalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set internalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setInternalId(array $internalId = array())
    {
        // validation for constraint: array
        if ('' !== ($internalIdArrayErrorMessage = self::validateInternalIdForArrayConstraintsFromSetInternalId($internalId))) {
            throw new \InvalidArgumentException($internalIdArrayErrorMessage, __LINE__);
        }
        $this->internalId = $internalId;
        return $this;
    }
    /**
     * Add item to internalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToInternalId(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The internalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->internalId[] = $item;
        return $this;
    }
    /**
     * Get isprimarysub value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getIsprimarysub()
    {
        return $this->isprimarysub;
    }
    /**
     * This method is responsible for validating the values passed to the setIsprimarysub method
     * This method is willingly generated in order to preserve the one-line inline validation within the setIsprimarysub method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateIsprimarysubForArrayConstraintsFromSetIsprimarysub(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicIsprimarysubItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicIsprimarysubItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicIsprimarysubItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicIsprimarysubItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicIsprimarysubItem), var_export($customerSubsidiaryRelationshipSearchRowBasicIsprimarysubItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The isprimarysub property can only contain items of type \StructType\SearchColumnBooleanField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set isprimarysub value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $isprimarysub
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setIsprimarysub(array $isprimarysub = array())
    {
        // validation for constraint: array
        if ('' !== ($isprimarysubArrayErrorMessage = self::validateIsprimarysubForArrayConstraintsFromSetIsprimarysub($isprimarysub))) {
            throw new \InvalidArgumentException($isprimarysubArrayErrorMessage, __LINE__);
        }
        $this->isprimarysub = $isprimarysub;
        return $this;
    }
    /**
     * Add item to isprimarysub value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToIsprimarysub(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The isprimarysub property can only contain items of type \StructType\SearchColumnBooleanField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->isprimarysub[] = $item;
        return $this;
    }
    /**
     * Get primaryCurrency value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getPrimaryCurrency()
    {
        return $this->primaryCurrency;
    }
    /**
     * This method is responsible for validating the values passed to the setPrimaryCurrency method
     * This method is willingly generated in order to preserve the one-line inline validation within the setPrimaryCurrency method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validatePrimaryCurrencyForArrayConstraintsFromSetPrimaryCurrency(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicPrimaryCurrencyItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicPrimaryCurrencyItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicPrimaryCurrencyItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicPrimaryCurrencyItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicPrimaryCurrencyItem), var_export($customerSubsidiaryRelationshipSearchRowBasicPrimaryCurrencyItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The primaryCurrency property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set primaryCurrency value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $primaryCurrency
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setPrimaryCurrency(array $primaryCurrency = array())
    {
        // validation for constraint: array
        if ('' !== ($primaryCurrencyArrayErrorMessage = self::validatePrimaryCurrencyForArrayConstraintsFromSetPrimaryCurrency($primaryCurrency))) {
            throw new \InvalidArgumentException($primaryCurrencyArrayErrorMessage, __LINE__);
        }
        $this->primaryCurrency = $primaryCurrency;
        return $this;
    }
    /**
     * Add item to primaryCurrency value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToPrimaryCurrency(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The primaryCurrency property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->primaryCurrency[] = $item;
        return $this;
    }
    /**
     * Get subsidiary value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getSubsidiary()
    {
        return $this->subsidiary;
    }
    /**
     * This method is responsible for validating the values passed to the setSubsidiary method
     * This method is willingly generated in order to preserve the one-line inline validation within the setSubsidiary method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateSubsidiaryForArrayConstraintsFromSetSubsidiary(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicSubsidiaryItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicSubsidiaryItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicSubsidiaryItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicSubsidiaryItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicSubsidiaryItem), var_export($customerSubsidiaryRelationshipSearchRowBasicSubsidiaryItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The subsidiary property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set subsidiary value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $subsidiary
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setSubsidiary(array $subsidiary = array())
    {
        // validation for constraint: array
        if ('' !== ($subsidiaryArrayErrorMessage = self::validateSubsidiaryForArrayConstraintsFromSetSubsidiary($subsidiary))) {
            throw new \InvalidArgumentException($subsidiaryArrayErrorMessage, __LINE__);
        }
        $this->subsidiary = $subsidiary;
        return $this;
    }
    /**
     * Add item to subsidiary value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToSubsidiary(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The subsidiary property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->subsidiary[] = $item;
        return $this;
    }
    /**
     * Get unbilledorders value
     * @return \StructType\SearchColumnDoubleField[]|null
     */
    public function getUnbilledorders()
    {
        return $this->unbilledorders;
    }
    /**
     * This method is responsible for validating the values passed to the setUnbilledorders method
     * This method is willingly generated in order to preserve the one-line inline validation within the setUnbilledorders method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateUnbilledordersForArrayConstraintsFromSetUnbilledorders(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerSubsidiaryRelationshipSearchRowBasicUnbilledordersItem) {
            // validation for constraint: itemType
            if (!$customerSubsidiaryRelationshipSearchRowBasicUnbilledordersItem instanceof \StructType\SearchColumnDoubleField) {
                $invalidValues[] = is_object($customerSubsidiaryRelationshipSearchRowBasicUnbilledordersItem) ? get_class($customerSubsidiaryRelationshipSearchRowBasicUnbilledordersItem) : sprintf('%s(%s)', gettype($customerSubsidiaryRelationshipSearchRowBasicUnbilledordersItem), var_export($customerSubsidiaryRelationshipSearchRowBasicUnbilledordersItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The unbilledorders property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set unbilledorders value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField[] $unbilledorders
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setUnbilledorders(array $unbilledorders = array())
    {
        // validation for constraint: array
        if ('' !== ($unbilledordersArrayErrorMessage = self::validateUnbilledordersForArrayConstraintsFromSetUnbilledorders($unbilledorders))) {
            throw new \InvalidArgumentException($unbilledordersArrayErrorMessage, __LINE__);
        }
        $this->unbilledorders = $unbilledorders;
        return $this;
    }
    /**
     * Add item to unbilledorders value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField $item
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function addToUnbilledorders(\StructType\SearchColumnDoubleField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnDoubleField) {
            throw new \InvalidArgumentException(sprintf('The unbilledorders property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->unbilledorders[] = $item;
        return $this;
    }
    /**
     * Get customFieldList value
     * @return \StructType\SearchColumnCustomFieldList|null
     */
    public function getCustomFieldList()
    {
        return $this->customFieldList;
    }
    /**
     * Set customFieldList value
     * @param \StructType\SearchColumnCustomFieldList $customFieldList
     * @return \StructType\CustomerSubsidiaryRelationshipSearchRowBasic
     */
    public function setCustomFieldList(\StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this->customFieldList = $customFieldList;
        return $this;
    }
}
