<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AllianceConsortiumType StructType
 * @package Dg
 * @subpackage Structs
 */
class DgAllianceConsortiumType extends AbstractStructBase
{
    /**
     * The AllianceMember
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgAllianceMember[]
     */
    public $AllianceMember;
    /**
     * The ID
     * @var string
     */
    public $ID;
    /**
     * The EffectiveDate
     * @var string
     */
    public $EffectiveDate;
    /**
     * The ExpireDate
     * @var string
     */
    public $ExpireDate;
    /**
     * Constructor method for AllianceConsortiumType
     * @uses DgAllianceConsortiumType::setAllianceMember()
     * @uses DgAllianceConsortiumType::setID()
     * @uses DgAllianceConsortiumType::setEffectiveDate()
     * @uses DgAllianceConsortiumType::setExpireDate()
     * @param \dgsoft\StructType\DgAllianceMember[] $allianceMember
     * @param string $iD
     * @param string $effectiveDate
     * @param string $expireDate
     */
    public function __construct(array $allianceMember = array(), $iD = null, $effectiveDate = null, $expireDate = null)
    {
        $this
            ->setAllianceMember($allianceMember)
            ->setID($iD)
            ->setEffectiveDate($effectiveDate)
            ->setExpireDate($expireDate);
    }
    /**
     * Get AllianceMember value
     * @return \dgsoft\StructType\DgAllianceMember[]|null
     */
    public function getAllianceMember()
    {
        return $this->AllianceMember;
    }
    /**
     * Set AllianceMember value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgAllianceMember[] $allianceMember
     * @return \dgsoft\StructType\DgAllianceConsortiumType
     */
    public function setAllianceMember(array $allianceMember = array())
    {
        foreach ($allianceMember as $allianceConsortiumTypeAllianceMemberItem) {
            // validation for constraint: itemType
            if (!$allianceConsortiumTypeAllianceMemberItem instanceof \dgsoft\StructType\DgAllianceMember) {
                throw new \InvalidArgumentException(sprintf('The AllianceMember property can only contain items of \dgsoft\StructType\DgAllianceMember, "%s" given', is_object($allianceConsortiumTypeAllianceMemberItem) ? get_class($allianceConsortiumTypeAllianceMemberItem) : gettype($allianceConsortiumTypeAllianceMemberItem)), __LINE__);
            }
        }
        $this->AllianceMember = $allianceMember;
        return $this;
    }
    /**
     * Add item to AllianceMember value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgAllianceMember $item
     * @return \dgsoft\StructType\DgAllianceConsortiumType
     */
    public function addToAllianceMember(\dgsoft\StructType\DgAllianceMember $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgAllianceMember) {
            throw new \InvalidArgumentException(sprintf('The AllianceMember property can only contain items of \dgsoft\StructType\DgAllianceMember, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->AllianceMember[] = $item;
        return $this;
    }
    /**
     * Get ID value
     * @return string|null
     */
    public function getID()
    {
        return $this->ID;
    }
    /**
     * Set ID value
     * @param string $iD
     * @return \dgsoft\StructType\DgAllianceConsortiumType
     */
    public function setID($iD = null)
    {
        // validation for constraint: string
        if (!is_null($iD) && !is_string($iD)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iD)), __LINE__);
        }
        $this->ID = $iD;
        return $this;
    }
    /**
     * Get EffectiveDate value
     * @return string|null
     */
    public function getEffectiveDate()
    {
        return $this->EffectiveDate;
    }
    /**
     * Set EffectiveDate value
     * @param string $effectiveDate
     * @return \dgsoft\StructType\DgAllianceConsortiumType
     */
    public function setEffectiveDate($effectiveDate = null)
    {
        // validation for constraint: string
        if (!is_null($effectiveDate) && !is_string($effectiveDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($effectiveDate)), __LINE__);
        }
        $this->EffectiveDate = $effectiveDate;
        return $this;
    }
    /**
     * Get ExpireDate value
     * @return string|null
     */
    public function getExpireDate()
    {
        return $this->ExpireDate;
    }
    /**
     * Set ExpireDate value
     * @param string $expireDate
     * @return \dgsoft\StructType\DgAllianceConsortiumType
     */
    public function setExpireDate($expireDate = null)
    {
        // validation for constraint: string
        if (!is_null($expireDate) && !is_string($expireDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($expireDate)), __LINE__);
        }
        $this->ExpireDate = $expireDate;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \dgsoft\StructType\DgAllianceConsortiumType
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
