<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for VehicleReservationRQCoreTypeSpecialEquipPrefs StructType
 * @package Dg
 * @subpackage Structs
 */
class DgVehicleReservationRQCoreTypeSpecialEquipPrefs extends AbstractStructBase
{
    /**
     * The SpecialEquipPref
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref[]
     */
    public $SpecialEquipPref;
    /**
     * The Charge
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgVehicleChargeType
     */
    public $Charge;
    /**
     * Constructor method for VehicleReservationRQCoreTypeSpecialEquipPrefs
     * @uses DgVehicleReservationRQCoreTypeSpecialEquipPrefs::setSpecialEquipPref()
     * @uses DgVehicleReservationRQCoreTypeSpecialEquipPrefs::setCharge()
     * @param \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref[] $specialEquipPref
     * @param \dgsoft\StructType\DgVehicleChargeType $charge
     */
    public function __construct(array $specialEquipPref = array(), \dgsoft\StructType\DgVehicleChargeType $charge = null)
    {
        $this
            ->setSpecialEquipPref($specialEquipPref)
            ->setCharge($charge);
    }
    /**
     * Get SpecialEquipPref value
     * @return \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref[]|null
     */
    public function getSpecialEquipPref()
    {
        return $this->SpecialEquipPref;
    }
    /**
     * Set SpecialEquipPref value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref[] $specialEquipPref
     * @return \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefs
     */
    public function setSpecialEquipPref(array $specialEquipPref = array())
    {
        foreach ($specialEquipPref as $vehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPrefItem) {
            // validation for constraint: itemType
            if (!$vehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPrefItem instanceof \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref) {
                throw new \InvalidArgumentException(sprintf('The SpecialEquipPref property can only contain items of \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref, "%s" given', is_object($vehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPrefItem) ? get_class($vehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPrefItem) : gettype($vehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPrefItem)), __LINE__);
            }
        }
        $this->SpecialEquipPref = $specialEquipPref;
        return $this;
    }
    /**
     * Add item to SpecialEquipPref value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref $item
     * @return \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefs
     */
    public function addToSpecialEquipPref(\dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref) {
            throw new \InvalidArgumentException(sprintf('The SpecialEquipPref property can only contain items of \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefsSpecialEquipPref, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->SpecialEquipPref[] = $item;
        return $this;
    }
    /**
     * Get Charge value
     * @return \dgsoft\StructType\DgVehicleChargeType|null
     */
    public function getCharge()
    {
        return $this->Charge;
    }
    /**
     * Set Charge value
     * @param \dgsoft\StructType\DgVehicleChargeType $charge
     * @return \dgsoft\StructType\DgVehicleReservationRQCoreTypeSpecialEquipPrefs
     */
    public function setCharge(\dgsoft\StructType\DgVehicleChargeType $charge = null)
    {
        $this->Charge = $charge;
        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\DgVehicleReservationRQCoreTypeSpecialEquipPrefs
     */
    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__;
    }
}
